Ionic ios build fails, error archive not found

后端 未结 6 724
礼貌的吻别
礼貌的吻别 2020-12-07 15:44

I\'ve been trying to figure this out, but there doesn\'t seem to be any light at the end of the tunnel, thus trying it here...hope you can help.

I have an Ionic proj

相关标签:
6条回答
  • 2020-12-07 16:09

    An Example for a working build.json (to place into your cordova / ionic project root directory) is the following content:

     {
      "ios": {
        "debug": {
          "buildFlag": [
            "-UseModernBuildSystem=0"
          ]
        },
        "release": {
          "buildFlag": [
            "-UseModernBuildSystem=0"
          ]
        }
      }
    }
    

    For more parameters about build.json see also cordova doc: https://cordova.apache.org/docs/en/latest/guide/platforms/ios/

    0 讨论(0)
  • 2020-12-07 16:13

    In addition to the above answer given by @jcesarmobile, another solution is to build the app with the Ionic CLI by executing the following command:

    ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
    

    According to the documentation of the ionic build command, to pass additional options to the Cordova CLI you should use the -- separator after the Ionic CLI arguments. The execution of the build command through Ionic CLI instead of Cordova CLI will also build web assets and provide friendly checks before cordova merely builds the app.

    0 讨论(0)
  • 2020-12-07 16:14

    Currently cordova-ios is not compatible with Xcode 10

    You can try to disable the new build system that Xcode 10 uses and use the old one by adding this to your build.json file

    "buildFlag": [
      "-UseModernBuildSystem=0"
    ]
    

    or adding --buildFlag="-UseModernBuildSystem=0" to the build command

    The full command should be cordova build ios --buildFlag="-UseModernBuildSystem=0".

    Or for Ionic ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"

    0 讨论(0)
  • 2020-12-07 16:17

    Hope this is still helpful.

    A couple of Pitfalls: Preparing the XCODE file.

    It’s time to prepare the project to be opened in XCODE. However Ionic-Cordova doesn’t support the NEW build system of XCODE. So the project has to be prepared for the Legacy build system. Pitfall #2. Important! Disconnect your iPhone or iPad device connected to the Mac or the following command won’t work!!! Pitfall #3.

    ionic cordova build ios --prod --buildFlag='-UseModernBuildSystem=0'
    

    Congrats! Your MyApp.xcodeproj(ect) file is ready. You’re almost half way to have an IPA uploaded. Just double click on the Myapp.xcodeproj file or open it through XCODE.

    There are several other pitfalls you will find:

    • It’s a common Pitfall#4 to not have the proper privilege set. In particular the rol “Developer” (Pitfall#4.1) doesn’t have privileges to push Apps to the Store
    • Double check that the “Bundle Identifier” is exactly the one you set in the config.xml file!
    • XCODE exposes a Signing bug, Pitfall#5, so untick the “Automatically manage signing” and tick again. You will face this bug for sure.

    XCODE bugs and Cordova not supporting properly the new building system leads to all these issues. I made a full guide showing how to fix them after lurking hours. Hope it helps!

    0 讨论(0)
  • 2020-12-07 16:24

    The command suggested by jcesarmobile didn't work for me, but doing

    cordova build ios --buildFlag="-UseModernBuildSystem=0"

    (without ionic) succesfully completed the build.

    After that I've been able to do ionic cordova build ios without any problems. (even without the buildFlag). I'm not an expert in this, in fact it was a mistake not to include ionic lol. So, although everything seems to work ok i'm not sure if there are any drawbacks in building with only cordova for the first time. Maybe someone can throw some light in the comments

    0 讨论(0)
  • 2020-12-07 16:26

    In My case I have to specify the swift compiler version and workspace settings in XCODE 10.2.1

    NOTE : In my project I have installed Onesignal plugin

    First I specified the swift compiler version.

    1. Open the myproject-name.workspace file because cocoapods installed.
    2. Go to Build Settings Tab in xcode.
    3. Scroll very bottom of the build settings tab find Swift Compiler - Language.
    4. Select the Swift version from the Swift Language Version drop down (Ex : Swift 4).

    Then Change the workspace setting

    1. Go to Xcode File Menu
    2. Select Workspace Settings
    3. Select Legacy Build System from the Build System drop down
    4. Click Done

    And after all try to rebuild with following command in terminal

    ionic cordova build ios
    
    0 讨论(0)
提交回复
热议问题