简体   繁体   中英

Flutter : Build Error during 'flutter build ios'

We are trying to build our flutter app for IOS but we keep getting error messages. We've been scrapping the web for almost 8 hours to find a solution but none worked.

This is the error that shows in the console:

Building ... for device (ios-release)...
Automatically signing iOS for device deployment using specified development team in Xcode project: T75QH2RS6D
Running pod install...                                              8,8s
Running Xcode build...                                                  
Xcode build done.                                           110,5s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    Writing result bundle at path:
        /var/folders/n1/_qynvt2d4j3_6mgk3fm106k40000gn/T/flutter_tools.Hg2HE1/flutter_ios_build_temp_dirfk4woH/temporary_xcresult_bundle

    2 warnings generated.
    /Users/rominhood/Logiciels/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-4.1.0/ios/Classes/FLTFirebaseFirestorePlugin.m:474:29: warning: comparison of distinct pointer types ('FIRQuery *' and
    'NSNull * _Nonnull') [-Wcompare-distinct-pointer-types]
      if (query == nil || query == [NSNull null]) {
                          ~~~~~ ^  ~~~~~~~~~~~~~
    1 warning generated.

    Failed to package /Users/rominhood/PRENT/Projects/Personal/rikiki.
    Command PhaseScriptExecution failed with a nonzero exit code
    note: Building targets in dependency order
    note: Removed stale file
    '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/XCFrameworkIntermediates/GoogleAppMeasurement/AdIdSupport/GoogleAppMeasurementIdent
    itySupport.framework'

    note: Removed stale file
    '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/XCFrameworkIntermediates/GoogleUserMessagingPlatform/UserMessagingPlatform.framewor
    k'

    note: Removed stale file
    '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/XCFrameworkIntermediates/GoogleAppMeasurement/WithoutAdIdSupport/GoogleAppMeasureme
    nt.framework'

    note: Removed stale file
    '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/XCFrameworkIntermediates/Google-Mobile-Ads-SDK/GoogleMobileAds.framework'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/gRPC-C++/gRPCCertificates-Cpp.bundle'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/GTMSessionFetcher/GTMSessionFetcher.framework'

    note: Removed stale file
    '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/GTMSessionFetcher/GTMSessionFetcher.framework.dSYM/Contents/Resources/DWARF/GTMSess
    ionFetcher'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/path_provider_ios/path_provider_ios.framework'

    note: Removed stale file
    '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/path_provider_ios/path_provider_ios.framework.dSYM/Contents/Resources/DWARF/path_pr
    ovider_ios'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/nanopb/nanopb.framework'

    note: Removed stale file
    '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/nanopb/nanopb.framework.dSYM/Contents/Resources/DWARF/nanopb'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/Libuv-gRPC/uv.framework'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/Libuv-gRPC/uv.framework.dSYM/Contents/Resources/DWARF/uv'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/rate_my_app/rate_my_app.framework'

    note: Removed stale file
    '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/rate_my_app/rate_my_app.framework.dSYM/Contents/Resources/DWARF/rate_my_app'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/shared_preferences_ios/shared_preferences_ios.framework'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/leveldb-library/leveldb.framework'

    note: Removed stale file
    '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/leveldb-library/leveldb.framework.dSYM/Contents/Resources/DWARF/leveldb'

    note: Removed stale file
    '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/shared_preferences_ios/shared_preferences_ios.framework.dSYM/Contents/Resources/DWA
    RF/shared_preferences_ios'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/google_mobile_ads/google_mobile_ads.framework'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/GoogleUtilities/GoogleUtilities.framework'

    note: Removed stale file
    '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/GoogleUtilities/GoogleUtilities.framework.dSYM/Contents/Resources/DWARF/GoogleUtili
    ties'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/fluttertoast/fluttertoast.framework'

    note: Removed stale file
    '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/fluttertoast/fluttertoast.framework.dSYM/Contents/Resources/DWARF/fluttertoast'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/firebase_core/firebase_core.framework'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/cloud_firestore/cloud_firestore.framework'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/Toast/Toast.framework'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/Toast/Toast.framework.dSYM/Contents/Resources/DWARF/Toast'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/Pods_Runner.framework'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/firebase_auth/firebase_auth.framework'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/FirebaseCore/FirebaseCore.framework'

    note: Removed stale file
    '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/FirebaseCore/FirebaseCore.framework.dSYM/Contents/Resources/DWARF/FirebaseCore'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/PromisesObjC/FBLPromises.framework'

    note: Removed stale file
    '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/PromisesObjC/FBLPromises.framework.dSYM/Contents/Resources/DWARF/FBLPromises'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/FirebaseFirestore/FirebaseFirestore.framework'

    note: Removed stale file
    '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/FirebaseFirestore/FirebaseFirestore.framework.dSYM/Contents/Resources/DWARF/Firebas
    eFirestore'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/FirebaseCoreInternal/FirebaseCoreInternal.framework'

    note: Removed stale file
    '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/FirebaseCoreInternal/FirebaseCoreInternal.framework.dSYM/Contents/Resources/DWARF/F
    irebaseCoreInternal'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/FirebaseAuth/FirebaseAuth.framework'

    note: Removed stale file
    '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/FirebaseAuth/FirebaseAuth.framework.dSYM/Contents/Resources/DWARF/FirebaseAuth'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/Runner.app'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/Runner.app.dSYM/Contents/Resources/DWARF/Runner'

    note: Removed stale file
    '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/Runner.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/Runner.swiftmodule/arm64-apple-ios.abi.json'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/Runner.swiftmodule/arm64-apple-ios.swiftdoc'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/Runner.swiftmodule/arm64-apple-ios.swiftmodule'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/BoringSSL-GRPC/openssl_grpc.framework'

    note: Removed stale file
    '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/BoringSSL-GRPC/openssl_grpc.framework.dSYM/Contents/Resources/DWARF/openssl_grpc'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/abseil/absl.framework'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/abseil/absl.framework.dSYM/Contents/Resources/DWARF/absl'

    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/gRPC-Core/grpc.framework'

    note: Removed stale file
    '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/gRPC-Core/grpc.framework.dSYM/Contents/Resources/DWARF/grpc'

    warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the
    script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'abseil' from project 'Pods')
    warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure
    it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
    warning: Run script build phase 'Thin Binary' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure
    it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
    warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the
    script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Libuv-gRPC' from project 'Pods')
    warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the
    script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'BoringSSL-GRPC' from project 'Pods')
    note: Removed stale file '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/gRPC-C++/grpcpp.framework'

    note: Removed stale file
    '/Users/rominhood/Library/Developer/Xcode/DerivedData/Runner-giiheketkpathjhacgxnfvexostk/Build/Products/Release-iphoneos/gRPC-C++/grpcpp.framework.dSYM/Contents/Resources/DWARF/grpcpp'

    warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the
    script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'gRPC-Core' from project 'Pods')
    warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the
    script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'gRPC-C++' from project 'Pods')

    Result bundle written to path:
        /var/folders/n1/_qynvt2d4j3_6mgk3fm106k40000gn/T/flutter_tools.Hg2HE1/flutter_ios_build_temp_dirfk4woH/temporary_xcresult_bundle


Encountered error while building for device.

And this is the flutter doctor result:

[✓] Flutter (Channel stable, 3.3.9, on macOS 13.0.1 22A400 darwin-arm, locale fr-FR)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.74.0)
[✓] Connected device (5 available)
[✓] HTTP Host Availability

• No issues found!

Any help would be appreciated, we're completely lost and almost bold.

Try to remove VALID_ARCHS from Project -> Build Settings -> User-Defined

https://github.com/CocoaPods/CocoaPods/issues/8035#issuecomment-764692977

And also clean the build folder under Product -> Clean Build Folder after you removed it

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM