Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

mapbox.png missing on upgrade to 3.0.1 with CocoaPods #3281

Closed
adamszeptycki opened this issue Dec 14, 2015 · 18 comments
Closed

mapbox.png missing on upgrade to 3.0.1 with CocoaPods #3281

adamszeptycki opened this issue Dec 14, 2015 · 18 comments
Labels
crash iOS Mapbox Maps SDK for iOS

Comments

@adamszeptycki
Copy link

I did update from version 2.2.1 to 3.0.1.
And I'm getting a crash on start with this Exception:

2015-12-14 16:45:42.280 MyAppName[10922:245407] *** Terminating app due to uncaught exception 'Resource not found', reason: 'The resource named “mapbox.png” could not be found in the Mapbox resource bundle.'
*** First throw call stack:
(
    0   CoreFoundation                      0x0000000104f02e65 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x00000001059c5deb objc_exception_throw + 48
    2   CoreFoundation                      0x0000000104f02d9d +[NSException raise:format:] + 205
    3   MyAppName                              0x0000000101ac8251 _Z35MGLLatLngBoundsFromCoordinateBounds19MGLCoordinateBounds + 41521
    4   MyAppName                              0x0000000101ac80f7 _Z35MGLLatLngBoundsFromCoordinateBounds19MGLCoordinateBounds + 41175
    5   MyAppName                              0x0000000101ab510f _Z17durationInSecondsf + 3215
    6   MyAppName                              0x0000000101ab466e _Z17durationInSecondsf + 494
    7   UIKit                               0x00000001031737db -[UIClassSwapper initWithCoder:] + 241
    8   UIKit                               0x0000000103347822 UINibDecoderDecodeObjectForValue + 705
    9   UIKit                               0x0000000103347558 -[UINibDecoder decodeObjectForKey:] + 278
    10  UIKit                               0x00000001031734b1 -[UIRuntimeConnection initWithCoder:] + 180
    11  UIKit                               0x0000000103347822 UINibDecoderDecodeObjectForValue + 705
    12  UIKit                               0x00000001033479e3 UINibDecoderDecodeObjectForValue + 1154
    13  UIKit                               0x0000000103347558 -[UINibDecoder decodeObjectForKey:] + 278
    14  UIKit                               0x00000001031726c3 -[UINib instantiateWithOwner:options:] + 1255
    15  UIKit                               0x0000000102f4beea -[UIViewController _loadViewFromNibNamed:bundle:] + 381
    16  UIKit                               0x0000000102f4c816 -[UIViewController loadView] + 178
    17  UIKit                               0x0000000102f4cb74 -[UIViewController loadViewIfRequired] + 138
    18  UIKit                               0x0000000102f91651 -[UINavigationController _layoutViewController:] + 54
    19  UIKit                               0x0000000102f91f26 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 462
    20  UIKit                               0x0000000102f92098 -[UINavigationController _startTransition:fromViewController:toViewController:] + 126
    21  UIKit                               0x0000000102f932f1 -[UINavigationController _startDeferredTransitionIfNeeded:] + 890
    22  UIKit                               0x0000000102f943af -[UINavigationController __viewWillLayoutSubviews] + 57
    23  UIKit                               0x000000010313aff7 -[UILayoutContainerView layoutSubviews] + 248
    24  UIKit                               0x0000000102e6d4a3 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 703
    25  QuartzCore                          0x0000000102b0a59a -[CALayer layoutSublayers] + 146
    26  QuartzCore                          0x0000000102afee70 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
    27  QuartzCore                          0x0000000102afecee _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
    28  QuartzCore                          0x0000000102af3475 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277
    29  QuartzCore                          0x0000000102b20c0a _ZN2CA11Transaction6commitEv + 486
    30  QuartzCore                          0x0000000102b2137c _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
    31  CoreFoundation                      0x0000000104e2e367 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
    32  CoreFoundation                      0x0000000104e2e2d7 __CFRunLoopDoObservers + 391
    33  CoreFoundation                      0x0000000104e2384c CFRunLoopRunSpecific + 524
    34  UIKit                               0x0000000102db17cd -[UIApplication _run] + 402
    35  UIKit                               0x0000000102db6610 UIApplicationMain + 171
    36  MyAppName                              0x000000010192f9eb _TF6MyAppNameU_FT_T_ + 267
    37  libswiftObjectiveC.dylib            0x00000001063f0bc9 _TF10ObjectiveC15autoreleasepoolFFT_T_T_ + 41
    38  MyAppName                              0x000000010192f6fc main + 92
    39  libdyld.dylib                       0x00000001065a392d start + 1
    40  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

Any ideas how to approach that issue?

Framework was installed using cocoa pods.

@friedbunny
Copy link
Contributor

mapbox.png is the watermark at the bottom left of every map and is distributed as part of our SDK.

@adamszeptycki This seems like a CocoaPods issue. Nuking your project's CocoaPods install is always good place to start: rm -rf Pods/ && rm Podfile.lock && pod install

If the issue persists, post your Podfile contents and we can go from there.

@friedbunny friedbunny added iOS Mapbox Maps SDK for iOS crash labels Dec 14, 2015
@friedbunny friedbunny changed the title App Crashes on start (3.0.1) mapbox.png missing on upgrade to 3.0.1 with CocoaPods Dec 14, 2015
@adamszeptycki
Copy link
Author

Reinstalling pods, cleaning simulator and derived data helped.

@adamszeptycki
Copy link
Author

It happened again.
After few successful runs I decided to clean simulator (I wanted to try out the app on clean build). And I have exactly the same error. Reinstalling pods once more didn't help. Any ideas?

@adamszeptycki adamszeptycki reopened this Dec 15, 2015
@friedbunny
Copy link
Contributor

Is there anything unusual in your Podfile?

@adamszeptycki
Copy link
Author

It looks like this:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
inhibit_all_warnings!
use_frameworks!

target :MyAppName do
pod `Mapbox-iOS-SDK`
#(a lot of other pods)
end 
target :MyAppNameTests do
pod `OHHTTPStubs`
#(some testings pods)
end 
post_install do |installer|
    installer.pods_project.targets.each do |target|
        if target.name == 'Mapbox-iOS-SDK-Mapbox' || target.name == 'Mapbox-iOS-SDK'
            target.build_configurations.each do |config|
                config.build_settings['ENABLE_BITCODE'] = 'NO'
            end
        end
    end
end

I also tried without that last part with bitcode, with exactly the same results.

@friedbunny
Copy link
Contributor

With 3.0.0 we do support bitcode, so you're able to get rid of that if you like.

The bundling of the various resources should be managed entirely by CocoaPods, but you might make sure that the files in Pods/Mapbox-iOS-SDK/Resources/ are members of the Mapbox-iOS-SDK-Mapbox target:

screen shot 2015-12-15 at 5 28 02 pm

@friedbunny
Copy link
Contributor

Also, make sure you're using the latest version of CocoaPods (v0.39):

> pod --version
0.39.0
> [sudo] gem install cocoapods
...

@adamszeptycki
Copy link
Author

I have done fresh install with 3.0.1 (without that bitcode configuration).
I have newest version of CocoaPods (0.39).
And still app is crashing.
I did check and mapbox.png is member of Mapbox-iOS-SDK-Mapbox target.

It's weird since it works without any problems with version 2.1.2

@karlnoelle
Copy link

I’ve got the same problem with the missing mapbox.png resource. I had been following the First Steps tutorial on the Mapbox website. Here’s my Podfile:

platform :ios, '8.0'
pod 'Mapbox-iOS-SDK'
use_frameworks!

Running CocoaPods 0.39.0

@Georgette
Copy link

I installed this without cocoa pods by following the tutorial installation instructions, and same issue.

I downgraded to 2.1.2 using the same installation steps, working as expected.

@adamszeptycki
Copy link
Author

@friedbunny Any updates on that?
I think there is more and more people with this problem.

@friedbunny
Copy link
Contributor

@adamszeptycki I haven't been able to reproduce this locally, it'd be quite helpful if we had a small project that reliably crashed.

#3034 may be the culprit, but I don't see anything glaring there.

@Georgette
Copy link

Just in case and of this helps: I'm using El Capitan OS with Xcode 7.2 and react native 0.17.0, installing with npm 2.14.14 and manually setting up the config as dictated by the guide. It breaks (with error: 'The resource named “mapbox.png” could not be found in the Mapbox resource bundle) when I include mixins: [Mapbox.Mixin] in my react class. I checked my installation steps rigorously for errors.

@therachelbentley
Copy link

@friedbunny I've been running into the same issue without using pods - I created a small working example of this here.

@therachelbentley
Copy link

Referring to my earlier post, if Mapbox.bundle is contained inside the Mapbox directory the app crashes due to "Terminating app due to uncaught exception 'Resource not found', reason: 'The resource named “mapbox.png” could not be found in the Mapbox resource bundle.'" If you just drag and drop Mapbox.bundle outside of the Mapbox directory the app runs fine. Also, you'll have to add your MGLMapboxAccessToken in the plist to test the project. - Hope this helps.

@bloemy7
Copy link

bloemy7 commented Jan 25, 2016

I'm having this issue having followed the exact "Static framework" installation protocol (https://github.com/mapbox/mapbox-gl-native/blob/master/platform/ios/INSTALL.md).

I have the exact same error message:
Terminating app due to uncaught exception 'Resource not found', reason: 'The resource named “mapbox.png” could not be found in the Mapbox resource bundle.'

@1ec5
Copy link
Contributor

1ec5 commented Jan 27, 2016

We made resource loading more robust as part of #3183, which also introduced a dynamic framework. Please try uninstalling the SDK and installing this prerelease instead (for CocoaPods, use this podspec). Archives ending in “-dynamic.zip” contain only the dynamic framework; the others contain both dynamic and static frameworks.

We’re pretty certain the dynamic framework doesn’t suffer from this issue. If you run into this issue with the prerelease static framework, please confirm that Mapbox.framework is listed in your application target’s Embed Frameworks build phase rather than the Copy Bundle Resources build phase.

@1ec5 1ec5 closed this as completed Jan 27, 2016
@1ec5
Copy link
Contributor

1ec5 commented Jan 27, 2016

Make that v3.1.0-pre.2 (podspec).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
crash iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

No branches or pull requests

7 participants