Flutter: App is not x86_64. Running lipo -info:, App is architecture: arm64

1,251

Solution 1

I am not sure about the actual reason behind this issue. I just deleted the project and Xcode's derived data from my system and then recloned the same project again and it was working fine in both simulator and real device.

So as per my experience, I am assuming that while running the build in release mode using flutter run --release command or by changing Xcode > Edit scheme > Run > Release there might be some changes within the default project settings and because of that I was getting " Could not build the precompiled application for the device." this error.

I have also raised an issue on GitHub for the same.

Solution 2

Your project probably has a run-script build phase for removing simulator architecture (in order to avoid AppStore rejection).

This script is usually a variation of this one: http://ikennd.ac/blog/2015/02/stripping-unwanted-architectures-from-dynamic-libraries-in-xcode/

If the project build runs such a script, the build might fail when the destination is a simulator and not a real device.

My suggestion: Find this script (in Target Settings -> Build Phases) and enclose it in:

    if [[ "$CONFIGURATION" == "Release" ]]; then
    [Put original script here]
    fi
Share:
1,251
Dhaval Kansara
Author by

Dhaval Kansara

iOS | Flutter Developer

Updated on December 16, 2022

Comments

  • Dhaval Kansara
    Dhaval Kansara over 1 year

    I built my project on a real iOS device and it was working fine but when I tried to run it on the simulator it gives me the below architecture error. Also, I have faced the same issue earlier and that time App was working fine for simulator and gave me the same error for the real device.

     Non-fat binary /Users/dhavalkansara/Library/Developer/Xcode/DerivedData/Runner-dwtuugielmxutoatpwezjbbcemuy/Build/Products/Debug-iphonesimulator/Runner.app/Frameworks/App.framework/App is not x86_64. Running lipo -info:
     Non-fat file: /Users/dhavalkansara/Library/Developer/Xcode/DerivedData/Runner-dwtuugielmxutoatpwezjbbcemuy/Build/Products/Debug-iphonesimulator/Runner.app/Frameworks/App.framework/App is architecture: arm64
     Command /bin/sh failed with exit code 1
    

    I tried multiple solutions available #25260, #22749, #23917 on GitHub but still facing the same issue.

  • Arik Segal
    Arik Segal over 4 years
    Oops I didn't see that the question is about Flutter.
  • Dhaval Kansara
    Dhaval Kansara over 4 years
    Yes, I am facing this issue in my Flutter project.
  • Arik Segal
    Arik Segal over 4 years
    I develop natively with xCode and I don't know Flutter, but the output "Command /bin/sh failed with exit code 1" does imply that a shell script was executed and returned a failure exit code. There is also a mention of "lipo" which is a command line utility that is used in order to manipulate binary files. Therefor I would advise you to take a closer look at the link in the answer and read the article in it.
  • Dhaval Kansara
    Dhaval Kansara about 4 years
    @princeoo7 yes I have answered for the question please check it.