0

I have been working with PhoneGap to access the camera, which works locally when built to the iPhone, but when I upload to TestFlight, the same method fails and gives me the following:

'NSInvalidArgumentException', reason: '[__NSCFString JSONObject]'

The arguments that are being passed are as follows:

[["Camera1856949628","Camera","takePicture",[25,0,1,100,100,1,0,false,false,false,null,0]]]

From what I gather its failing in CDVJSON.m when converting an NSString to JSONObject which in turn is an NSArray.

Any suggestions on what might be causing this?

jnpetersen
  • 50
  • 8

1 Answers1

0

Because your code don't use the JSONObject until runtime. So CDVJSON.m didn't linked in the app.

Fixed the issue by adding "Other Linker Flags: -all_load" in your project. As suggested by this answer: https://stackoverflow.com/a/17581430/2570865

Community
  • 1
  • 1
kilik52
  • 664
  • 1
  • 6
  • 13