mapbox / mapbox/mapbox-maps-flutter

Library not loaded on iOS

Open
#295 9 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dart
Stars
380
Forks
204
PR merge metrics
No merged PRs in 30d

Description

I am trying to embed a Flutter module in a native iOS app by following Option B - Embed frameworks in Xcode.

I created two empty projects (one iOS app and one Flutter app). I managed to build my iOS frameworks (by running flutter build ios-framework) and I've embedded them in the native project in Xcode. It worked perfectly 😄

I then added a dependency on mapbox_maps_flutter to my na Flutter project and generated the frameworks again. Now when I run the native iOS app, I get an error in Xcode console:

dyld[76011]: Library not loaded: @rpath/MapboxCommon.framework/MapboxCommon
  Referenced from: <EC49D31C-3E96-3C4A-B4A9-503189E7BBEF> /Users/dumbass/Library/Developer/Xcode/DerivedData/NativeXFlutter-hgnhvvxjnufjnmawpvamreicccpm/Build/Products/Debug-iphonesimulator/mapbox_maps_flutter.framework/mapbox_maps_flutter
  Reason: tried: '/Users/dumbass/Library/Developer/Xcode/DerivedData/NativeXFlutter-hgnhvvxjnufjnmawpvamreicccpm/Build/Products/Debug-iphonesimulator/MapboxCommon.framework/MapboxCommon' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_21A328/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.0.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/MapboxCommon.framework/MapboxCommon' (no such file), '/usr/lib/swift/MapboxCommon.framework/MapboxCommon' (no such file, not in dyld cache), '/Users/dumbass/Library/Developer/CoreSimulator/Devices/BC8A49E8-826E-4AD4-A33E-284F5FBB25FE/data/Containers/Bundle/Application/DEEA242F-FD06-443C-9C88-AB6007127CC6/NativeXFlutter.app/Frameworks/MapboxCommon.framework/MapboxCommon' (no such file), '/Users/dumbass/Library/Developer/Xcode/DerivedData/NativeXFlutter-hgnhvvxjnufjnmawpvamreicccpm/Build/Products/Debug-iphonesimulator/mapbox_maps_flutter.framework/Frameworks/MapboxCommon.framework/MapboxCommon' (no such file), '/Users/dumbass/Library/Developer/CoreSimulator/Devices/BC8A49E8-826E-4AD4-A33E-284F5FBB25FE/data/Containers/Bundle/Application/DEEA242F-FD06-443C-9C88-AB6007127CC6/NativeXFlutter.app/Frameworks/MapboxCommon.framework/MapboxCommon' (no such file), '/Users/dumbass/Library/Developer/CoreSimulator/Devices/BC8A49E8-826E-4AD4-A33E-284F5FBB25FE/data/Containers/Bundle/Application/DEEA242F-FD06-443C-9C88-AB6007127CC6/NativeXFlutter.app/Frameworks/MapboxCommon.framework/MapboxCommon' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_21A328/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.0.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/MapboxCommon.framework/MapboxCommon' (no such file)Library not loaded: @rpath/MapboxCommon.framework/MapboxCommon
  Referenced from: <2916445A-F516-369B-AA7E-F24C91A3239C> /Users/dumbass/Library/Developer/Xcode/DerivedData/NativeXFlutter-hgnhvvxjnufjnmawpvamreicccpm/Build/Products/Debug-iphonesimulator/MapboxMaps.framework/MapboxMaps
  Reason: tried: '/Users/dumbass/Library/Developer/Xcode/DerivedData/NativeXFlutter-hgnhvvxjnufjnmawpvamreicccpm/Build/Products/Debug-iphonesimulator/MapboxCommon.framework/MapboxCommon' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_21A328/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.0.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/MapboxCommon.framework/MapboxCommon' (no such file), '/usr/lib/swift/MapboxCommon.framework/MapboxCommon' (no such file, not in dyld cache), '/Users/dumbass/Library/Developer/CoreSimulator/Devices/BC8A49E8-826E-4AD4-A33E-284F5FBB25FE/data/Containers/Bundle/Application/DEEA242F-FD06-443C-9C88-AB6007127CC6/NativeXFlutter.app/Frameworks/MapboxCommon.framework/MapboxCommon' (no such file), '/Users/dumbass/Library/Developer/Xcode/DerivedData/NativeXFlutter-hgnhvvxjnufjnmawpvamreicccpm/Build/Products/Debug-iphonesimulator/MapboxMaps.framework/Frameworks/MapboxCommon.framework/MapboxCommon' (no such file), '/Users/dumbass/Library/Developer/CoreSimulator/Devices/BC8A49E8-826E-4AD4-A33E-284F5FBB25FE/data/Containers/Bundle/Application/DEEA242F-FD06-443C-9C88-AB6007127CC6/NativeXFlutter.app/Frameworks/MapboxCommon.framework/MapboxCommon' (no such file), '/Users/dumbass/Library/Developer/CoreSimulator/Devices/BC8A49E8-826E-4AD4-A33E-284F5FBB25FE/data/Containers/Bundle/Application/DEEA242F-FD06-443C-9C88-AB6007127CC6/NativeXFlutter.app/Frameworks/MapboxCommon.framework/MapboxCommon' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_21A328/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.0.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/MapboxCommon.framework/MapboxCommon' (no such file)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Flutter module and the native Xcode project described in the report, reproducing the setup with flutter build ios-framework. Inspect how the generated mapbox_maps_flutter, MapboxMaps, and MapboxCommon frameworks are embedded and loaded. Done means the native iOS app launches without the reported dyld library-loading error.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter, ios
Domain
build-system, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.