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
[Add2App IOS] Instant crash on MacOS12.0.1 xcode13.1 Library not loaded: @rpath/App.framework/App #92896
Comments
Hi @yanwei49 |
flutter doctor -v:
|
|
I have similar situation. crash:
flutter doctor -v:
|
@yanwei49 are you trying to add flutter to an existing ios app? if yes can you please refer the add to app docs and share which option are you using Option A, B or C? Thanks |
@geGao123 The error you are hitting seems different than the one reported here, I would advise you to please file a separate issue by filling in the details requested in the issue template. Thanks |
I use A,It is normal before upgrading the macOS system and xcode. |
I had the same problem, also use A ,😭 |
@yanwei49 @Aflysun I tried running this add to app sample and it's working fine for me on macOS 12.0.1 with xcode 13, so this is likely not an issue with macOS version or Xcode version, Can you please share a complete project for us to have a look. flutter doctor -v
Thanks |
try xcode13.1 |
I had the same problem, also use A |
demo link:https://gitee.com/yanwei49/flutterdemo |
I tried running this add to app sample and it's working crash for me xcode13.1: |
I tried xcode12.5,xcode13, xcode13.1 , but I couldn't |
Is it related to Apple M1?My computer is Apple Mini macOS13.0.1 |
My xcode version 13.1 , I suspect it's the Xcode version ,I'll try the lower xcode version. |
It's not a problem with the Xcode version, i tried xcode12.5,xcode13,xcode13.1 |
[✗] Android toolchain - develop for Android devices [✓] Xcode - develop for iOS and macOS (Xcode 13.1) [✓] Chrome - develop for the web [!] Android Studio (not installed) [✓] VS Code (version 1.61.2) [✓] Connected device (3 available) ! Doctor found issues in 2 categories. |
It did solve the problem, Look at kxifenger's solution, But can you tell us why this is done? |
@yanwei49 @kxifenger |
@yanwei49 @Aflysun, I did try running with Xcode 13.1 and the ios module runs fine in Xcode.
Even this application builds successfully. Please make sure you are running the .xcworkspace file, You can find the steps to run the application in the readme of sample app |
I tried running this add to app sample and it's working crash for me xcode13.1, But now the problem has been solved, The solution is provided by @kxifenger , But can you tell us why this is done? |
@yanwei49 I am not really sure why it worked.
Provided you last message I feel it's safe to close the issue, If you disagree feel free to write in the comments and I will reopen it. |
I had the same problem, also use A |
I have try to the macOS big Sur 11.3.1 + Xcode 13.1 and it's OK。But crashed in macOS Monterey 12.0.1 + Xcode 13.1. I suspect it has something to do with the system |
@maheshmnj Why don't you try it on macOS Monterey 12.0.1 |
@WeMadeCode I did please check flutter doctor #92896 (comment) |
[✓] Flutter (Channel stable, 2.5.3, on macOS 12.0.1 21A559 darwin-x64, locale zh-Hans-CN) [!] Android toolchain - develop for Android devices (Android SDK version 30.0.3) [✓] Xcode - develop for iOS and macOS [✓] Chrome - develop for the web [✓] Android Studio (version 2020.3) [✓] VS Code (version 1.62.0) [✓] Connected device (2 available) |
Same problem here on macOS 12.0.1 & Xcode 13.1. After some investigations, I found that when building on macOS Monterey, two new load commands ( Problem disappeared after upgrading |
Please try update ruby and Cocoapods to latest version. can fix it. This problem make me feel sick. it wasted my day.......fuck!!!! good luck!!!! |
This is working for me!! Thank you very much! |
|
Thanks iamjjh |
|
This is right correctly solution for this problem !!! |
it because , you fix procedure where really error lead to. let's check right procedure , that should be. def install_flutter_application_pod(flutter_application_path)
current_directory_pathname = Pathname.new File.expand_path('..', __FILE__)
app_framework_dir = File.expand_path('App.framework', current_directory_pathname.to_path)
app_framework_dylib = File.join(app_framework_dir, 'App')
if !File.exist?(app_framework_dylib)
# Fake an App.framework to have something to link against if the xcode backend script has not run yet.
# CocoaPods will not embed the framework on pod install (before any build phases can run) if the dylib does not exist.
# Create a dummy dylib.
FileUtils.mkdir_p(app_framework_dir)
`echo "static const int Moo = 88;" | xcrun clang -x c -dynamiclib -o "#{app_framework_dylib}" -`
end
# Keep pod and script phase paths relative so they can be checked into source control.
# Process will be run from project directory.
# defined_in_file is set by CocoaPods and is a Pathname to the Podfile.
project_directory_pathname = defined_in_file.dirname
relative = current_directory_pathname.relative_path_from project_directory_pathname
pod 'xxxx_flutter', :path => relative.to_s, :inhibit_warnings => true
flutter_export_environment_path = File.join('${SRCROOT}', relative, 'flutter_export_environment.sh');
script_phase :name => 'Run Flutter Build xxxx_flutter Script',
:script => "set -e\nset -u\nsource \"#{flutter_export_environment_path}\"\nexport VERBOSE_SCRIPT_LOGGING=1 && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/xcode_backend.sh build",
:execution_position => :before_compile
end it insert a build phase (Run Flutter Build xxxx_flutter Script) before compile , then Embed Pods Frameworks script should embed app.framework which build last step. (which the script is generated by pod install) final your flutter project is build & embed into your ios host project. Now error comes from so your fix solution mention the app.framework path , app.framework can be found and embed into your ios host project. hope it clear to solve your question. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
crash is run on the Device, but it is normal on the simulator,It is normal before upgrading MacOS.
current version:Swift version:5.5.1,xcode version:13.1,flutter version:2.5.3
crash:
The text was updated successfully, but these errors were encountered: