I tried to build and run the multiple_flutters_ios
example located in https://github.com/flutter/samples/tree/master/add_to_app/multiple_flutters/multiple_flutters_ios on my iOS device following the instructions given in the readme (using master of flutter @ https://github.com/flutter/flutter/commit/39c5d2fa0a9836014bf8e2bde6842edbb767df56 and xcode 13.2.1):
cd ../multiple_flutters_module
flutter pub get
cd -
pod install
open MultipleFluttersIos.xcworkspace
# (build and run)
When running the app with xcode, it crashes with the following error:
Library not loaded: @rpath/App.framework/App
Referenced from: /private/var/containers/Bundle/Application/87326E6C-36A4-4235-B2CA-25AFC260B730/MultipleFluttersIos.app/MultipleFluttersIos
Reason: tried: '/usr/lib/swift/App.framework/App' (no such file), '/private/var/containers/Bundle/Application/87326E6C-36A4-4235-B2CA-25AFC260B730/MultipleFluttersIos.app/Frameworks/App.framework/App' (no such file), '/private/var/containers/Bundle/Application/87326E6C-36A4-4235-B2CA-25AFC260B730/MultipleFluttersIos.app/Frameworks/App.framework/App' (no such file), '/private/var/containers/Bundle/Application/87326E6C-36A4-4235-B2CA-25AFC260B730/MultipleFluttersIos.app/Frameworks/App.framework/App' (no such file), '/usr/lib/swift/App.framework/App' (no such file), '/private/var/containers/Bundle/Application/87326E6C-36A4-4235-B2CA-25AFC260B730/MultipleFluttersIos.app/Frameworks/App.framework/App' (no such file), '/private/var/containers/Bundle/Application/87326E6C-36A4-4235-B2CA-25AFC260B730/MultipleFluttersIos.app/Frameworks/App.framework/App' (no such file), '/private/var/containers/Bundle/Application/87326E6C-36A4-4235-B2CA-25AFC260B730/MultipleFluttersIos.app/Frameworks/App.framework/App' (no such file), '/System/Library/Frameworks/App.framework/App' (no such file)
Looks like the bundle that xcode produces for the app does not include the AOT compiled dart code for the app (App.framework).
flutter doctor -v
[✓] Flutter (Channel master, 2.10.0-1.0.pre.361, on macOS 12.1 21C52 darwin-x64, locale en)
• Flutter version 2.10.0-1.0.pre.361 at /Users/goderbauer/dev/flutter
• Upstream repository [email protected]:goderbauer/flutter.git
• Framework revision 39c5d2fa0a (19 hours ago), 2022-02-01 14:58:27 -0800
• Engine revision 20de5d73c6
• Dart version 2.17.0 (build 2.17.0-69.0.dev)
• DevTools version 2.10.0-dev.1
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/goderbauer/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: /Applications/Android Studio with Blaze.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2020.3)
• Android Studio at /Applications/Android Studio with Blaze.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
[✓] Android Studio (version 4.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
[✓] IntelliJ IDEA Community Edition (version 2021.2.3)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin version 62.0.3
• Dart plugin version 212.5632
[✓] Connected device (4 available)
• iPhone (mobile) • 00008020-00013D380C85002E • ios • iOS 15.3 19D50
• iPhone 13 (mobile) • 542027A8-5CC8-403C-8616-F42B689E2362 • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-2 (simulator)
• macOS (desktop) • macos • darwin-x64 • macOS 12.1 21C52 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 97.0.4692.99
[✓] HTTP Host Availability
• All required HTTP hosts are available