Flutter - iOS: Command /bin/sh failed with exit code 255

前端 未结 6 2031
萌比男神i
萌比男神i 2021-02-20 03:54

Good afternoon,

I try to run a Flutter project on iOS, previously successfully run on Android. However, I got an error:

\"x86_64\" is not an allowed valu         


        
相关标签:
6条回答
  • 2021-02-20 04:40

    For me helped:

    1. Disconnect all physical phone's from mac.
    2. Close Xcode.
    3. In terminal command

      flutter clean

    4. Start Xcode by running Runner.xcworkspace, that you have inside your project folder /yourProjectFolder/ios/Runner

    1. Choose menu Product - Archive

    1. That's it! After that build was successful. Appear windows where you can distribute app.

    0 讨论(0)
  • 2021-02-20 04:41

    I solve the problem with the following commands.

    flutter clean
    flutter build ios
    

    After that I can create signed builds and also upload to App Stores.

    0 讨论(0)
  • 2021-02-20 04:42

    This exit code (255) occurs from incorrectly Generated.xcconfig configuration like TRACK_WIDGET_CREATION, FLUTTER_FRAMEWORK_DIR, FLUTTER_BUILD_MODE In archive ios release mode. So before archiving make sure to run flutter clean then flutter build ios for some reason flutter build ios --release doesn't work for me. Then lastly go to Xcode and archive the ios app

    Commands

    flutter clean then

    flutter build ios

    Hope it helps.

    0 讨论(0)
  • 2021-02-20 04:43

    After lots of try i follow these steps to release ipa file :

    1. Go to your trminal:
    2. cd your-flutter-project
    3. flutter run (That will launch the app to your connected or opened device )

    Now, come to again to your MAC terminal and type

    • flutter build apk (that will make the release apk)

    For IOS,

    • flutter build ios

    after complete the task you will see the path of your file package something like

    /Users/Sanjeev/Documents/WorkSpaceForFlutter/myapp/build/ios/iph oneos/Runner.app.

    Now go to Xcode >Product >Archive you will get the screen below

    This is how i resolve my issue Command /bin/sh failed with exit code 255

    0 讨论(0)
  • 2021-02-20 04:50

    This issue happened to me after building a release version. It seems that iOS emulators does not support release versions.

    If you want to run your app on an emulator you will need to build a debug version

    flutter clean
    flutter build ios --debug
    
    0 讨论(0)
  • 2021-02-20 04:54

    For me, it happenned that I was opening .xcodeproj (WRONG) file instead of .xcworkspace (RIGHT)

    0 讨论(0)
提交回复
热议问题