2

I have a project which incorporated mapbox-ios-sdk sometime ago. Mapbox-ios-sdk has undergone some changes but I've also hacked some code into it. So I try to merge the Mapbox-ios-sdk from origin into my branch, and after some struggle finally it has compiled. However, I've run into this error:

2012-10-16 19:09:26.466 OfflineSpotty[81420:11f03] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unable to find LoadingTile.png (copy from framework 'Resources' folder)'

The images are properly added in the left pane. Why is it not finding it?

EDIT:

The line it fails is: RMRequireAsset(@"LoadingTile.png")

I see that it actually fails on an NSAssert:

#define RMRequireAsset(asset) NSAssert([[NSBundle mainBundle] pathForResource:[asset stringByReplacingOccurrencesOfString:[@"." stringByAppendingString:[asset pathExtension]] withString:@""] ofType:[asset pathExtension]], @"Unable to find %@ (copy from framework 'Resources' folder)", asset);

And the more complete message

`* Assertion failure in -[RMLoadingTileView initWithFrame:], /Users/t2wu/Documents/Xcode_projects/Open_source/mapbox-ios-sdk/MapView/Map/RMLoadingTileView.m:24 2012-10-16 20:24:58.456 OfflineSpotty[17713:11f03] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unable to find LoadingTile.png (copy from framework 'Resources' folder)''

huggie
  • 17,587
  • 27
  • 82
  • 139
  • And this has nothing to do with http://stackoverflow.com/questions/8689235/could-not-load-nib-in-bundle-nsbundle-when-using-storyboarding? – VonC Oct 16 '12 at 12:03
  • It's not that I can't load nib, so I'm think it's different. – huggie Oct 16 '12 at 12:24
  • Maybe it's not a merge problem afterall. I am checking what its doing. – huggie Oct 16 '12 at 12:34
  • It's just not loading for some reason. [[NSBundle mainBundle] pathForResource: @"LoadingTile" ofType:@".png"] and [UIImage imageNamed:@"LoadingTile.png"] both return nil. – huggie Oct 16 '12 at 12:45
  • There is no copy bundle resources in the Mapbox-ios-sdk project. I added the files in. However, that doesn't help either. – huggie Oct 16 '12 at 12:52
  • @huggie Did you solve it? I am facing the exact same problem. – The dude Nov 09 '12 at 10:07

1 Answers1

2

I faced that same problem and finally found a solution for it.

There is a file called MapBox.bundle inside the mapbox ios sdk project, as seen in the following image: MapView project

All I had to do was to add in my main project target (I guess you'll have to add it to OfflineSpotty target) that MapBox.bundle (I just used drag and drop).

Mapbox bundle target

After that, the project builds and runs ok.

The dude
  • 7,896
  • 1
  • 25
  • 50
  • Thanks. Yeah I ended up posting on the Mapbox forum and I was told that was the solution. – huggie Nov 10 '12 at 07:55
  • I've just realized that this is different from what I did. My old version of the Mapbox sdk only check for specific images. I simply referenced the relevant image files from Mapbox into my project. However the recent develop branch specifically checked for the Mapbox bundle instead of the images. And drag and drop is the only way I could add it, not the plus sign. (I am using the simulator and the MapBox.bundle is red, if that has anything to do with it). – huggie Nov 20 '12 at 09:44
  • @huggie I used drag and drop too. Plus sign did not work for me either. I just added the sharekit framework to my project too, and it was also using the .bundle file thing. In the installing instructions they directly point to use drag and drop to use the bundle file. https://github.com/ShareKit/ShareKit/wiki/Installing-sharekit Cheers! – The dude Nov 21 '12 at 13:37