mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.35k stars 1.33k forks source link

Library Not Loaded #4056

Closed dailenspencer closed 8 years ago

dailenspencer commented 8 years ago

After adding the MapBox Framework to my project, I am receiving the following error :

dyld: Library not loaded: @rpath/Mapbox.framework/Mapbox Referenced from: /private/var/mobile/Containers/Bundle/Application/2D2A4D3A-A590-471C-B0D6-546CE4C124AB/greek.app/greek Reason: image not found (lldb)

This error occurs when attempting to run on device only. So far I have found two routes that solve the issue temporarily but the project still doesnt run as expected.

Add MapBox framework to "embedded binaries". Only issue is that if i attempt to archive the project after doing so, I receive a ton of errors about unsupported architectures and other things.

Set MapBox framework to "optional". This allows the project to run. However, when presenting a viewcontroller that contains the MGLMapView, the project crashes.

Ive also tried disabling bitcode but that hasnt helped. Any suggestions?

1ec5 commented 8 years ago

If you installed the SDK manually, please refer to the README.md for installation instructions. In particular:

  1. Add Mapbox.framework to the Embedded Binaries section of the project editor. (Adding it there automatically adds it to the Linked Frameworks and Libraries section too.)
  2. Add the suggested Run Script build phase, which strips out the portion of the framework intended for the Simulator whenever you archive the project.

It shouldn’t be necessary to disable Bitcode for the SDK to work. Please let us know if you run into any issues after performing these steps.

jonasbark commented 8 years ago

//EDIT: I fixed it... I really hate Apple for that. I had to create a new certificate, new provisioning profile, new App ID and it finally worked. I leave this comment here for anyone else with this problem.

@1ec5 I have the exact same problem on any of our test devices.

What I did:

The problem with cocoapods: if I add, as suggested, use_frameworks! to my Podfile I'm getting the crash mentioned above with other Libraries I'm using (e.g. AFNetworking). If I'm removing use_frameworks! I'm getting the crash below.

Running the app via Xcode works fine, but installing it using In House certificates and running it fails with the following crash:

Incident Identifier: 195BC20E-A896-455D-912E-C2E43E29D4F2
CrashReporter Key:   3054e0476174e6080becd72c412cbc3872f328ec
Hardware Model:      iPhone5,2
Process:             (...) [2150]
Path:                /private/var/mobile/Containers/Bundle/Application/AA127574-DCBC-43BA-AD88-F3552B197340/(...).app/(...)
Identifier:          de.ffuf.(...).release
Version:             1 (1.0)
Code Type:           ARM (Native)
Parent Process:      launchd [1]

Date/Time:           2016-03-09 13:40:55.55 +0100
Launch Time:         2016-03-09 13:40:54.54 +0100
OS Version:          iOS 9.2.1 (13D15)
Report Version:      105

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000000e7ffdefe
Triggered by Thread:  0

Filtered syslog:
None found

Dyld Error Message:
Dyld Message: Library not loaded: @rpath/Mapbox.framework/Mapbox
  Referenced from: /var/mobile/Containers/Bundle/Application/AA127574-DCBC-43BA-AD88-F3552B197340/(...).app/(...)
  Reason: no suitable image found.  Did find:
    /private/var/mobile/Containers/Bundle/Application/AA127574-DCBC-43BA-AD88-F3552B197340/(...).app/Frameworks/Mapbox.framework/Mapbox: mmap() errno=1 validating first page of '/private/var/mobile/Containers/Bundle/Application/AA127574-DCBC-43BA-AD88-F3552B197340/(...).app/Frameworks/Mapbox.framework/Mapbox'
  Dyld Version: 370.6

Binary Images:
0x5d000 - 0x428fff (...) armv7  <fc45293017043c4eb779cbda9c6d7902> /var/mobile/Containers/Bundle/Application/AA127574-DCBC-43BA-AD88-F3552B197340/(...).app/(...)
0x1fe8f000 - 0x1feb6fff dyld armv7s  <bf233c7c81083586bfb84e9c19eb135c> /usr/lib/dyld

BTW, when Archiving the app I get this summary: image