Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MapboxMobileEvents - Library not loaded #9

Closed
zoolle opened this issue Feb 9, 2021 · 14 comments
Closed

MapboxMobileEvents - Library not loaded #9

zoolle opened this issue Feb 9, 2021 · 14 comments

Comments

@zoolle
Copy link

zoolle commented Feb 9, 2021

My built was succeeded but when the app started on real device get the following

dyld: Library not loaded: @rpath/MapboxMobileEvents.framework/MapboxMobileEvents
  Referenced from: /private/var/containers/Bundle/Application/E108BAAA-D3FA-4D6D-99CE-B1A6AB844FD4/driverapp.app/Frameworks/Mapbox.framework/Mapbox
  Reason: image not found
dyld: launch, loading dependent libraries
DYLD_LIBRARY_PATH=/usr/lib/system/introspection
DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
(lldb) 

Any idea what this could be? I want to say that I've followed all the steps in ReadMe and also the issue https://github.com/homeeondemand/react-native-mapbox-navigation/issues/6

@rossmartin
Copy link
Contributor

Can you confirm what version of cocoapods you are using? You can run pod --version in terminal.

@zoolle
Copy link
Author

zoolle commented Feb 9, 2021

@rossmartin I am using 1.10.1

@zoolle
Copy link
Author

zoolle commented Feb 9, 2021

@rossmartin I have just installed in a fresh react native project but same error. I've followed these steps.

  1. npx react-native init MyApp

  2. Installed react-native-mapbox-navigation

  3. Created the Bridge file

  4. Run pod install

  5. While building I've got the multiple commands produce error

  6. Added install! 'cocoapods', :disable_input_output_paths => true

  7. Run pod install

  8. While building no error

  9. After installed the app on device same error Library not loaded: @rpath/MapboxMobileEvents.framework/MapboxMobileEvents

@rossmartin
Copy link
Contributor

Thank you for the details. Do you happen to have other pods in this new RN project? What version of Xcode? You can post your Podfile if you'd like.

@zoolle
Copy link
Author

zoolle commented Feb 10, 2021

Here it is. Nothing apart of what was installed but react-native init

I am using xCode 12.3

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '10.0'
project 'driver.xcodeproj' 
install! 'cocoapods', :disable_input_output_paths => true
target 'driver' do
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])

  target 'driverTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  # use_flipper!
  # post_install do |installer|
  #   flipper_post_install(installer)
  # end
end

target 'driver-tvOS' do
  # Pods for driver-tvOS

  target 'driver-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end
end

@rossmartin
Copy link
Contributor

Thanks for posting. I don't see any smoking guns with the info you've shared. It's been a really long day here and I'm out of ideas currently. I'll revisit when I get a chance.

@zoolle
Copy link
Author

zoolle commented Feb 10, 2021

@rossmartin So now I've updated my xCode to 12.4 and I've tried even on simulator but same thing. I also managed to make it work somehow last night until I've cleaned up the project and build again as I had issues with language. After that same error

@dslapelis
Copy link

I also have this same error. Same steps to reproduce.

@rossmartin
Copy link
Contributor

rossmartin commented Feb 25, 2021

@zoolle and @dslapelis can you please try adding use_frameworks! to the top of your Podfile? Ex -

platform :ios, '10.0'
use_frameworks!

@rossmartin
Copy link
Contributor

@zoolle @dslapelis This issue has been resolved in the latest version (1.0.2) and use_frameworks! is no longer needed. There are also some additional notes to resolve potential build issues for ios - https://github.com/homeeondemand/react-native-mapbox-navigation#ios-specific-instructions

@dslapelis
Copy link

Thank you @rossmartin! I was just able to successfully build.

@MikeRayUX
Copy link

Having this issue also, however my application is an ejected expo project with many dependencies.
It works great for me on Android though not on iOS. I'd also note that with iOS, there are no build issues prior to adding this package.

I've also followed the iOS specific instructions properly and have made several attempts and double checks ensuring that all of the build setting's keys and values match the README instructions.

Error:

dyld: Library not loaded: @rpath/MapboxMobileEvents.framework/MapboxMobileEvents
  Referenced from: /private/var/containers/Bundle/Application/3F887212-3BDA-4339-A628-BA5C3C08BBD9/myapp.app/Frameworks/Mapbox.framework/Mapbox
  Reason: image not found
dyld: launch, loading dependent libraries
DYLD_LIBRARY_PATH=/usr/lib/system/introspection
DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
(lldb) 

--versions:
Xcode: 12.4
Xcode build system: New Build System
pod: 1.10.1
@homee/react-native-mapbox-navigation: ^1.0.5
react-native: 0.63.4
My PodFile:

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/react-native-unimodules/cocoapods.rb'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '10.0'
install! 'cocoapods', :disable_input_output_paths => true

target 'myapp' do
  use_unimodules!
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])

  # Uncomment the code below to enable Flipper.
  #
  # You should not install Flipper in CI environments when creating release
  # builds, this will lead to significantly slower build times.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work.

  # use_flipper!({ 'Flipper' => '0.74.0' })
  # # use_flipper!
  #  post_install do |installer|
  #    flipper_post_install(installer)
  #  end

  post_install do |installer|
    installer.pods_project.targets.each do |target|
     target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
     end
    end
   end
end

@zoolle
Copy link
Author

zoolle commented Mar 10, 2021

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/react-native-unimodules/cocoapods.rb'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '10.0'
install! 'cocoapods', :disable_input_output_paths => true

target 'myapp' do
  use_unimodules!
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])

  pre_install do |installer|
    $RNMBNAV.pre_install(installer)
  end

  # Uncomment the code below to enable Flipper.
  #
  # You should not install Flipper in CI environments when creating release
  # builds, this will lead to significantly slower build times.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work.

  # use_flipper!({ 'Flipper' => '0.74.0' })
  # # use_flipper!
  #  post_install do |installer|
  #    flipper_post_install(installer)
  #  end

  post_install do |installer|
    $RNMBNAV.post_install(installer)
    installer.pods_project.targets.each do |target|
     target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
     end
    end
   end
end

Try to run it like this

@MikeRayUX
Copy link

It worked! I'm quite surprised as $RNMBNAV previously returned undefined for me during early troubleshooting.

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

No branches or pull requests

4 participants