Reputation: 16276
In my project, i have imported some third party frameworks like google-maps. EveryThing work fine when compiling, but when it runs, the app crashes and i could track the suspicious method:
//Invoked when the class is instantiated in XIB
-(id)initWithCoder:(NSCoder*)aDecoder
{
self = [super initWithCoder:aDecoder];
if(self)
{
[self customInitialization];
}
return self;
}
Here is the stack of the crash i got:
TestMapDirections[1343:11603] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter'
*** First throw call stack:
(0x13ea052 0x2035d0a 0x1392a78 0x13929e9 0xae854b 0xae84d5 0x23e3f 0x23d17 0x223b0 0x2230b 0x29e5 0x2ae6 0x3d3335 0x4d1fa2 0x4d16b7 0x3d2ead 0x4d1fa2 0x4d19af 0x4d16b7 0x3d2305 0x5d884f 0x5d8dd7 0x13ebec9 0x1b75c2 0x1b755a 0x25cb76 0x25d03f 0x25c2fe 0x1dca30 0x1dcc56 0x1c3384 0x1b6aa9 0x1601fa9 0x13be1c5 0x1323022 0x132190a 0x1320db4 0x1320ccb 0x1600879 0x160093e 0x1b4a9b 0x2478 0x23d5)
terminate called throwing an exceptionsharedlibrary apply-load-rules all
Current language: auto; currently objective-c
You can download my application and try it on your stuff, maybe you can help me more figure out the problem, thanx in advance.
EDIT:
@JSON coco: here is the code of the customInitialization
method:
-(void)customInitialization
{
// do the initialization of class variables here..
mDirections = [UICGDirections sharedDirections];
mDirections.delegate = self;
}
Upvotes: 1
Views: 1330
Reputation: 78363
So, I looked over your code. It's actually the Google Map API that's crashing. It expects to find some file called api.html
. I'm not familiar with this framework the you're using, so I can't tell you what that html file is used for or where to get it. However, you need to find it and add it to your project file and make sure it gets into your Copy Resources build phase. To do that, just look in the File Utility Inspector on the right side of your editor (if it's not opened, you can open it by pressing CMD+ALT+1). After you add the api.html
file to your project, select it, and check to make sure it's checked for your target in the file inspector.
This will cause the crash to stop. If that file isn't actually needed, you can alter the line 39 of the file UICGoogleMapsAPI.m
. That's the line that's crashing since it can't file the api.html
file.
Upvotes: 2