Flutter iOS build failure error with Multiple commands after the Xcode upgrade

后端 未结 4 481
长情又很酷
长情又很酷 2020-12-09 18:02

Flutter iOS build fails after upgrading to Xcode 10.0 version in mac.

Nagendras-MacBook-Pro:uaenumber nagendra$ flutter run
Launching lib/main.dart on iPhone          


        
4条回答
  •  感情败类
    2020-12-09 18:28

    It's a known issue. Here is the explanation and some workarounds: https://github.com/flutter/flutter/issues/20685#issuecomment-421511890

    Affected projects

    This issue affects all Flutter projects built using Xcode 10 that have a dependency on CocoaPods -- typically this means those that rely on plugins. Workarounds

    There are two workarounds:

    • Option 1: Use the legacy build system . As noted by @gi097, open ios/Runner.xcworkspace, and change the build system to Legacy Build System.
    • Option 2: Use the new Xcode 10 build system. Open ios/Runner.xcworkspace Select the Runner project in the project navigator sidebar. In the main view, select the Runner target, then select the Build Phases tab. Expand the Embed Frameworks phase and select Flutter.framework from the embedded frameworks list. Click - to remove Flutter.framework from the list (be sure to keep App.framework).

    Root cause

    When plugins are in use, there are two competing build actions that copy Flutter.framework into the build application Frameworks directory:

    The Embed Frameworks build phase for the Runner project

    The [CP] Embed Pods Frameworks build phase that pod install creates in the project.

    Item (1) is there to ensure the framework is copied into the built app in the case where there are no plugins (and therefore no CocoaPods integration in the Xcode project). Item (2) is there because Flutter's podspec declares Flutter.framework as a vended_framework, and CocoaPods automatically adds a copy step for each such vended_framework in the transitive closure of CocoaPods dependencies.

提交回复
热议问题