question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

iOS Crash using 8.2.0-beta1

See original GitHub issue

Describe the bug
The app is crashing immediately on launch after build successful on xCode with this error message, any idea ? The version 8.1.0 was working perfectly

Note: I’m using $ReactNativeMapboxGLIOSVersion = '~> 6.3'

dyld: Library not loaded: @rpath/MapboxMobileEvents.framework/MapboxMobileEvents
  Referenced from: /private/var/containers/Bundle/Application/E4E5D882-DDD0-4A0F-A998-A668979617D5/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) 

I tried to add $RNMBGL.pre_install(installer) and $RNMBGL.post_install(installer) even if i’m using use_frameworks! on my Podfile and my pod install gives me another error:

* Changed MapboxMobileEvents to `static library`
[!] An error occurred while processing the post-install hook of the Podfile.

undefined local variable or method `mobile_events_target' for #<Object:0x00007fdc52521e68>

/Users/martin/Projects/myapp/node_modules/@react-native-mapbox-gl/maps/react-native-mapbox-gl.podspec:21:in `block in post_install'
/Users/martin/Projects/myapp/node_modules/@react-native-mapbox-gl/maps/react-native-mapbox-gl.podspec:16:in `each'
/Users/martin/Projects/myapp/node_modules/@react-native-mapbox-gl/maps/react-native-mapbox-gl.podspec:16:in `post_install'
/Users/martin/Projects/myapp/ios/Podfile:131:in `block (3 levels) in from_ruby'
/Users/martin/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/podfile.rb:179:in `post_install!'
/Users/martin/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:897:in `run_podfile_post_install_hook'
/Users/martin/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:885:in `block in run_podfile_post_install_hooks'
/Users/martin/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:145:in `message'
/Users/martin/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:884:in `run_podfile_post_install_hooks'
/Users/martin/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:329:in `block (2 levels) in create_and_save_projects'
/Users/martin/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb:61:in `write!'
/Users/martin/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:328:in `block in create_and_save_projects'
/Users/martin/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/Users/martin/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:307:in `create_and_save_projects'
/Users/martin/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:299:in `generate_pods_project'
/Users/martin/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:178:in `integrate'
/Users/martin/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:166:in `install!'
/Users/martin/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:52:in `run'
/Users/martin/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Users/martin/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
/Users/martin/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
/Users/martin/.rbenv/versions/2.6.5/bin/pod:23:in `load'
/Users/martin/.rbenv/versions/2.6.5/bin/pod:23:in `<main>'

To Reproduce
Launch an app using the package 8.2.0-beta1

Versions:

  • Platform: iOS
  • Platform OS: iOS 14.4
  • Device: iPhone 11 Pro
  • Emulator/ Simulator: no, real device
  • Dev OS: OSX 11.2.2
  • react-native-mapbox-gl Version 8.2.0-beta1
  • React Native Version: 0.62.2

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
martinfrouincommented, Mar 15, 2021

I found a trick to make it work with my situation by adding this on my pre_install, so it works now 😃

$dynamic_framework = ['MapboxMobileEvents']

  pre_install do |installer|
    $RNMBGL.pre_install(installer)
    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
    installer.pod_targets.each do |pod|
      if !$dynamic_framework.include?(pod.name)
        def pod.build_type;
          Pod::BuildType.static_library
        end
      end
    end
  end
0reactions
iamir4gcommented, Jun 6, 2021

I found a trick to make it work with my situation by adding this on my pre_install, so it works now 😃

$dynamic_framework = ['MapboxMobileEvents']

  pre_install do |installer|
    $RNMBGL.pre_install(installer)
    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
    installer.pod_targets.each do |pod|
      if !$dynamic_framework.include?(pod.name)
        def pod.build_type;
          Pod::BuildType.static_library
        end
      end
    end
  end

Which part of the podfile should I enter this code?

this is 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'

target 'bischariapp' do
  use_unimodules!
  config = use_native_modules!

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

  # Comment this code below to disable 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!
   post_install do |installer|
     flipper_post_install(installer)
   end
end
Read more comments on GitHub >

github_iconTop Results From Across the Web

iOS Crash using 8.2.0-beta1 · Issue #1270 · rnmapbox/maps
Describe the bug The app is crashing immediately on launch after build successful on xCode with this error message, any idea ?
Read more >
Diagnosing issues using crash reports and device logs
Use crash reports and device logs to debug app issues. ... When an app on iOS, iPadOS, watchOS, or tvOS uses memory inefficiently,...
Read more >
iOS and FirebaseCrashlytics - Stack Overflow
I was using Firebase Crashlytics version 4.0.0-beta.1 but after pod update it is 8.2.0. Step 2: Go to build phase add a run...
Read more >
Qt 6.2 Known Issues - Qt Wiki
Qt Version Overview New Features Qt 5.0 Qt 5.0.0 • Qt 5.0.1 Release New Features in Qt 5.0 Qt 5.1 Qt 5.1 Release New Features...
Read more >
Changelog - Nextcloud
We strongly recommend to stay up to date with Nextcloud to keep your data safe. ... Avoid a crash when a PHP extension...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found