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

dyld: Library not loaded:@rpath/MapboxMobileEvents.framework/MapboxMobileEvents #131

Closed
lcf001 opened this issue Jan 6, 2020 · 14 comments
Closed
Labels

Comments

@lcf001
Copy link

lcf001 commented Jan 6, 2020

Steps to reproduce

I compiled the SDK according to the instructions on the INSTALL.md and wrote a demo. When I run the demo I get the following error:
dyld: Library not loaded:@rpath/MapboxMobileEvents.framework/MapboxMobileEvents
So how to add this library if I compile the SDK myself.

Expected behavior

Actual behavior

Configuration

Mapbox SDK versions:
iOS/macOS versions:
Device/simulator models:
Xcode version:

@julianrex
Copy link
Contributor

@lcf001 can you please double check that the MapboxMobileEvents framework is embedded in your application? Check the "Frameworks, Libraries and Embedded Content" section of your application target.

It should look something like this:

Screen Shot 2020-01-06 at 3 30 13 PM

@julianrex julianrex added the build label Jan 6, 2020
@lcf001
Copy link
Author

lcf001 commented Jan 7, 2020

@julianrex I can't find the MapboxMobileEvents framework。In which folder is it when I compile the sdk?

@julianrex
Copy link
Contributor

julianrex commented Jan 7, 2020

MapboxMobileEvents.framework was recently added as a dependency. Please see the release notes: https://github.com/mapbox/mapbox-gl-native-ios/releases/tag/ios-v5.6.0

@lcf001
Copy link
Author

lcf001 commented Jan 8, 2020

@julianrex Do I download mapbox-ios-sdk-5.6.0-dynamic-with-events.zip separately? but it is too slow. Can I remove this dependency?

@julianrex
Copy link
Contributor

@lcf001 how are you integrating the Maps SDK? Manually, through Cocoapods or Carthage?

If manually, you should download mapbox-ios-sdk-5.6.0-dynamic-with-events.zip in preference over any other. The MapboxMobileEvents.framework is required, i.e. you cannot remove it.

For reference, this is not new code - it's been extracted from the Maps SDK to address some issues and to remove duplicated code.

I'm going to close this issue as answered.

@falnatsheh
Copy link

falnatsheh commented Jan 8, 2020

@julianrex I had the same issue when using Carthage, I believe the integration instructions need to be updated to include:

Then add the framework’s path to the Input Files for this script phase:

$(SRCROOT)/Carthage/Build/iOS/Mapbox.framework
$(SRCROOT)/Carthage/Build/iOS/MapboxMobileEvents.framework   ◀️ 

@1ec5
Copy link
Contributor

1ec5 commented Jan 9, 2020

Thank you, we’ll update this page shortly with the change you’ve suggested.

@jordanderson
Copy link

I think this page also needs to be updated to include MapboxMobileEvents.framework.

@jsgv
Copy link

jsgv commented Jan 18, 2020

I am installing with Cocoapods, but still receiving this error. Docs do not specify any special instructions regarding the framework using the Cocoapods method.

Edit:
use_frameworks! needs to be set in Podfile in order to work.

@anfriis
Copy link

anfriis commented Jan 23, 2020

I am installing with Cocoapods, but still receiving this error. Docs do not specify any special instructions regarding the framework using the Cocoapods method.

Edit:
use_frameworks! needs to be set in Podfile in order to work.

This is an unfortunate change IMO @julianrex.
The use_frameworks! flag will cause all pods in a project to be linked as dynamic frameworks which tend to make your app launch slower and increase in bundle size compared to using static libraries (link 1) (link 2). Apple also suggests going away from dynamic frameworks.
Furthermore it can cause build errors in apps that has other Pods that cannot be linked as a dynamic frameworks e.g. react-native-firebase, which also causes my app to throws errors when building.

@julianrex
Copy link
Contributor

@anfriis thanks for the comment. Building from source and/or providing a static framework is an important use-case and is being considered (see also #149).

@systemlevel
Copy link

systemlevel commented Jan 25, 2020

Running into the same wall as @anfriis has called out here. This is unfortunate.

We are stuck without a static framework being provided for similar reasons @anfriis has pointed out. Is there a reason why we are requiring the use of use_frameworks! when Apple is discouraging dynamic frameworks moving forward?

7.0.10 crashing on start #635 https://github.com/react-native-mapbox-gl/maps/issues/635

@like-milk
Copy link

@lcf001 can you please double check that the MapboxMobileEvents framework is embedded in your application? Check the "Frameworks, Libraries and Embedded Content" section of your application target.

It should look something like this:

Screen Shot 2020-01-06 at 3 30 13 PM

It worked! Thank you very much!

@swapnizzle
Copy link

I encountered this issue when trying to build to my actual iOS device (but it worked fine in the simulator). I spent at least 10 hours trying to fix this bug. Tried everything in all the forums, nothing worked. But this is what finally worked for me!

  • Upgrading from iOS 13.3.1 to iOS 13.4.1

I couldn't have imagined this, but its true that iOS 13.3.1 breaks the third parties signature unless you have a paid developer account!

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

No branches or pull requests

10 participants