skip to Main Content

I was trying to generate the ipa file to upload it on App Store but unfortunately it failed and says "Encountered error while archiving for device".
I also tried Archiving from Xcode but, the Archive failed there too. It is working great in ios simulator (13)

Failed to build iOS app
Error output from Xcode build:

** ARCHIVE FAILED **

Xcode’s output:
Writing result bundle at path:

    /var/folders/8s/2st2j0d97k7cm80h3968jnx80000gn/T/flutter_tools.ph1v
            kd/flutter_ios_build_temp_dirZbRdRw/temporary_xcresult_bundle
    
        error: the following command failed with exit code 0 but produced no
        further output
        CompileC
        
Failed to package /Users/sunsoft/Downloads/alifpet-app-master.
    Command PhaseScriptExecution failed with a nonzero exit code
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in dependency order
    /Users/sunsoft/Downloads/alifpet-app-master/ios/Pods/Pods.xcodeproj:
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
    set to 8.0, but the range of supported deployment target versions is
    9.0 to 15.2.99. (in target 'Sodium' from project 'Pods')
    /Users/sunsoft/Downloads/alifpet-app-master/ios/Pods/Pods.xcodeproj:
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
    set to 8.0, but the range of supported deployment target versions is
    9.0 to 15.2.99. (in target 'ReachabilitySwift' from project 'Pods')
    /Users/sunsoft/Downloads/alifpet-app-master/ios/Pods/Pods.xcodeproj:
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
    set to 8.0, but the range of supported deployment target versions is
    9.0 to 15.2.99. (in target 'Starscream' from project 'Pods')
    /Users/sunsoft/Downloads/alifpet-app-master/ios/Pods/Pods.xcodeproj:
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
    set to 6.0, but the range of supported deployment target versions is
    9.0 to 15.2.99. (in target 'Reachability' from project 'Pods')
    /Users/sunsoft/Downloads/alifpet-app-master/ios/Pods/Pods.xcodeproj:
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
    set to 7.0, but the range of supported deployment target versions is
    9.0 to 15.2.99. (in target 'AppAuth' from project 'Pods')
    /Users/sunsoft/Downloads/alifpet-app-master/ios/Pods/Pods.xcodeproj:
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
    set to 8.0, but the range of supported deployment target versions is
    9.0 to 15.2.99. (in target 'PusherSwiftWithEncryption' from project
    'Pods')
    /Users/sunsoft/Downloads/alifpet-app-master/ios/Pods/Pods.xcodeproj:
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
    set to 8.0, but the range of supported deployment target versions is
    9.0 to 15.2.99. (in target 'GoogleSignIn' from project 'Pods')
    /Users/sunsoft/Downloads/alifpet-app-master/ios/Pods/Pods.xcodeproj:
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
    set to 8.0, but the range of supported deployment target versions is
    9.0 to 15.2.99. (in target 'AgoraRtcEngine_iOS' from project 'Pods')

    Result bundle written to path:
        /var/folders/8s/2st2j0d97k7cm80h3968jnx80000gn/T/flutter_tools.ph1v
        kd/flutter_ios_build_temp_dirZbRdRw/temporary_xcresult_bundle
    
    Encountered error while archiving for device.

2

Answers


  1. The problem here is that the Podfile that Flutter template creates by default has no specific iOS version set unfortunately.

    Do this to fix this problem:

    1. in ios/ folder of your project, open the Podfile.
    2. At top of Podfile, make sure this line is not commented out and change the iOS version to 12.0.

    change from:

    #platform :ios, '8.0'
    

    to:

    platform :ios, '12.0'
    
    1. Run pod deintegrate in Terminal inside the ios/ folder of your project.

    2. Run pod install --repo-update in your ios/ folder

    This should do the trick!

    If after this you are getting the following error

    CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target

    Then you need to open your iOS workspace in Xcode and select your root project on top left, then inside the Info tab, choose your configuration (in this case Debug) and change it to None. After that, do pod install again.

    enter image description here

    Login or Signup to reply.
  2. I am getting this error while building with command flutter build ipa –release –no-tree-shake-icons while it is working fine when i archive with xcode.

    Result bundle written to path:
        /var/folders/ds/bbptl8p5391_lg2drzvrgt3w0000gn/T/flutter_tools.VLOTC5/flutter_ios_build_temp_d
        ir8SL9Nl/temporary_xcresult_bundle
    

    Uncategorized (Xcode): Exited with status code 1

    Encountered error while archiving for device.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search