使用Codemagic的iOS构建失败[与Xcode兼容很好]

问题描述

在Xcode中成功完成了构建,但是当我使用代码魔术进行构建时,它失败了。以下是我的构建失败日志。

下面是我从代码魔术收到的输出。它显示了Firebase和受众网络插件中的一些错误,但不是在Xcode中生成的。我在这里没有得到确切的错误

    == Building for iOS ==

    <span style="color:#268BD2">&gt; xcode-project use-profiles</span>
Configure code signing settings
Searching for files matching /Users/builder/Library/MobileDevice/Provisioning Profiles/*.mobileprovision

Searching for files matching /Users/builder/clone/**/*.xcodeproj
<span style="color:#859900">Completed configuring code signing settings</span>
 <span style="color:#268BD2">- Using profile "IOS Oct 2020" [-bb52-4b20-8f43-406ff4121bfb] for target "Runner" [Debug] from project "Runner"</span>
 <span style="color:#268BD2">- Using profile "IOS Oct 2020" [-bb52-4b20-8f43-406ff4121bfb] for target "Runner" [Profile] from project "Runner"</span>
 <span style="color:#268BD2">- Using profile "IOS Oct 2020" [-bb52-4b20-8f43-406ff4121bfb] for target "Runner" [Release] from project "Runner"</span>
<span style="color:#859900">Generated options for exporting IPA</span>
 <span style="color:#268BD2">- Method: app-store</span>
 <span style="color:#268BD2">- Provisioning Profiles:</span>
     <span style="color:#268BD2">- .linuxhandbook: IOS Oct 2020</span>
 <span style="color:#268BD2">- Signing Certificate: Apple distribution</span>
 <span style="color:#268BD2">- Signing Style: manual</span>
 <span style="color:#268BD2">- Team Id: C6272K7</span>
<span style="color:#859900">Saved export options to /Users/builder/export_options.plist</span>

<span style="color:#268BD2">&gt; /usr/local/bin/Flutter build ios --release --no-codesign</span>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Warning
──────────────────────────────────────────────────────────────────────────────
Your Flutter application is created using an older version of the Android
embedding. It's being deprecated in favor of Android embedding v2. Follow the
steps at

https://Flutter.dev/go/android-project-migration

to migrate your project.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Warning: Building for device with codesigning disabled. You will have to manually codesign before deploying to device.
Building androing.linuxhandbook for device (ios-release)...
Running pod install...                                            116.1s
Running Xcode build...                                          
Xcode build done.                                           128.3s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD Failed **


Xcode's output:
↳
    &lt;module-includes&gt;:1:9: note: in file included from &lt;module-includes&gt;:1:
    #import "Headers/FBAudienceNetwork.h"
            ^
    
                                     ^
    /Users/builder/clone/ios/Pods/FirebaseMessaging/FirebaseMessaging/Sources/Public/FIRMessaging.h:219:1: note: 'FIRMessagingRemoteMessage' has been explicitly marked deprecated here
    __deprecated_msg(
    ^
    In module 'UIKit' imported from /Users/builder/clone/ios/Pods/Target Support Files/firebase_messaging/firebase_messaging-prefix.pch:2:
    In module 'Foundation' imported from /Applications/Xcode-12.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:
    In module 'CoreFoundation' imported from /Applications/Xcode-12.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
    In module 'Darwin' imported from /Applications/Xcode-12.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:
    /Applications/Xcode-12.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/usr/include/sys/cdefs.h:200:48: note: expanded from macro '__deprecated_msg'
            #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                          ^
    /Users/builder/programs/Flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-6.0.16/ios/Classes/FLTFirebaseMessagingPlugin.m:141:30: warning: 'shouldEstablishDirectChannel' is deprecated: FCM direct channel is deprecated,please use APNs channel for downstream message delivery. [-Wdeprecated-declarations]
        [FIRMessaging messaging].shouldEstablishDirectChannel = true;
                                 ^
    In module 'FirebaseMessaging' imported from /Users/builder/clone/ios/Pods/Headers/Public/Firebase/Firebase.h:76:
    /Users/builder/clone/ios/Pods/FirebaseMessaging/FirebaseMessaging/Sources/Public/FIRMessaging.h:283:56: note: 'shouldEstablishDirectChannel' has been explicitly marked deprecated here
    @property(nonatomic) BOOL shouldEstablishDirectChannel DEPRECATED_MSG_ATTRIBUTE(
                                                           ^
    In module 'UIKit' imported from /Users/builder/clone/ios/Pods/Target Support Files/firebase_messaging/firebase_messaging-prefix.pch:2:
    In module 'Foundation' imported from /Applications/Xcode-12.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:
    In module 'CoreFoundation' imported from /Applications/Xcode-12.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
    In module 'Darwin' imported from /Applications/Xcode-12.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:
    /Applications/Xcode-12.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/usr/include/AvailabilityMacros.h:181:64: note: expanded from macro 'DEPRECATED_MSG_ATTRIBUTE'
                #define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
                                                                   ^
    /Users/builder/programs/Flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-6.0.16/ios/Classes/FLTFirebaseMessagingPlugin.m:196:52: warning: 'appData' is deprecated [-Wdeprecated-declarations]
      [self didReceiveRemoteNotification:remoteMessage.appData];
                                                       ^
    In module 'FirebaseMessaging' imported from /Users/builder/clone/ios/Pods/Headers/Public/Firebase/Firebase.h:76:
    /Users/builder/clone/ios/Pods/FirebaseMessaging/FirebaseMessaging/Sources/Public/FIRMessaging.h:226:62: note: 'appData' has been explicitly marked deprecated here
    @property(nonatomic,readonly,strong) NSDictionary *appData DEPRECATED_ATTRIBUTE;
                                                                 ^
    In module 'UIKit' imported from /Users/builder/clone/ios/Pods/Target Support Files/firebase_messaging/firebase_messaging-prefix.pch:2:
    In module 'Foundation' imported from /Applications/Xcode-12.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:
    In module 'CoreFoundation' imported from /Applications/Xcode-12.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
    In module 'Darwin' imported from /Applications/Xcode-12.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:
    /Applications/Xcode-12.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/usr/include/AvailabilityMacros.h:179:60: note: expanded from macro 'DEPRECATED_ATTRIBUTE'
            #define DEPRECATED_ATTRIBUTE        __attribute__((deprecated))
                                                               ^
    /Users/builder/programs/Flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-6.0.16/ios/Classes/FLTFirebaseMessagingPlugin.m:306:1: warning: implementing deprecated method [-Wdeprecated-implementations]
    - (void)messaging:(FIRMessaging *)messaging
    ^
    In module 'FirebaseMessaging' imported from /Users/builder/clone/ios/Pods/Headers/Public/Firebase/Firebase.h:76:
    /Users/builder/clone/ios/Pods/FirebaseMessaging/FirebaseMessaging/Sources/Public/FIRMessaging.h:253:1: note: method 'messaging:didReceiveMessage:' declared here
    - (void)messaging:(FIRMessaging *)messaging
    ^
    /Users/builder/programs/Flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-6.0.16/ios/Classes/FLTFirebaseMessagingPlugin.m:308:63: warning: 'appData' is deprecated [-Wdeprecated-declarations]
      [_channel invokeMethod:@"onMessage" arguments:remoteMessage.appData];
                                                                  ^
    In module 'FirebaseMessaging' imported from /Users/builder/clone/ios/Pods/Headers/Public/Firebase/Firebase.h:76:
    /Users/builder/clone/ios/Pods/FirebaseMessaging/FirebaseMessaging/Sources/Public/FIRMessaging.h:226:62: note: 'appData' has been explicitly marked deprecated here
    @property(nonatomic,strong) NSDictionary *appData DEPRECATED_ATTRIBUTE;
                                                                 ^
    In module 'UIKit' imported from /Users/builder/clone/ios/Pods/Target Support Files/firebase_messaging/firebase_messaging-prefix.pch:2:
    In module 'Foundation' imported from /Applications/Xcode-12.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:
    In module 'CoreFoundation' imported from /Applications/Xcode-12.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
    In module 'Darwin' imported from /Applications/Xcode-12.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:
    /Applications/Xcode-12.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/usr/include/AvailabilityMacros.h:179:60: note: expanded from macro 'DEPRECATED_ATTRIBUTE'
            #define DEPRECATED_ATTRIBUTE        __attribute__((deprecated))
                                                               ^
    6 warnings generated.
    /bin/sh: /Users/rushabhshah/Flutter/Flutter/packages/Flutter_tools/bin/xcode_backend.sh: No such file or directory
    Command PhaseScriptExecution Failed with a nonzero exit code
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
    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 14.0.99. (in target 'webview_Flutter' from project 'Pods')
    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 14.0.99. (in target 'url_launcher' from project 'Pods')
    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 14.0.99. (in target 'store_redirect' from project 'Pods')
    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 14.0.99. (in target 'sqflite' from project 'Pods')
    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 14.0.99. (in target 'shared_preferences' from project 'Pods')
    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 14.0.99. (in target 'share' from project 'Pods')
    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 14.0.99. (in target 'path_provider' from project 'Pods')
    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 14.0.99. (in target 'package_info' from project 'Pods')
    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 14.0.99. (in target 'nanopb' from project 'Pods')
    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 14.0.99. (in target 'firebase_messaging' from project 'Pods')
    warning: The use of Swift 3 @objc inference in Swift 4 mode is deprecated. Please address deprecated @objc inference warnings,test your code with “Use of deprecated Swift 3 @objc inference” logging enabled,and then disable inference by changing the "Swift 3 @objc Inference" build setting to "Default" for the "Runner" target. (in target 'Runner' from project 'Runner')
    warning: The use of Swift 3 @objc inference in Swift 4 mode is deprecated. Please address deprecated @objc inference warnings,and then disable inference by changing the "Swift 3 @objc Inference" build setting to "Default" for the "Runner" target. (in target 'Runner' from project 'Runner')
    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 14.0.99. (in target 'Protobuf' from project 'Pods')
    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 14.0.99. (in target 'PromisesObjC' from project 'Pods')
    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 14.0.99. (in target 'GoogleUtilities' from project 'Pods')
    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 14.0.99. (in target 'GoogleDataTransport' from project 'Pods')
    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 14.0.99. (in target 'FirebaseMessaging' from project 'Pods')
    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 14.0.99. (in target 'FirebaseInstanceID' from project 'Pods')
    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 14.0.99. (in target 'FirebaseInstallations' from project 'Pods')
    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 14.0.99. (in target 'FirebaseCoreDiagnostics' from project 'Pods')
    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 14.0.99. (in target 'FirebaseCore' from project 'Pods')
    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 14.0.99. (in target 'FMDB' from project 'Pods')
    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 14.0.99. (in target 'GoogleAppMeasurement' from project 'Pods')
    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 14.0.99. (in target 'Flutter' from project 'Pods')
    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 14.0.99. (in target 'FirebaseAnalytics' from project 'Pods')
    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 14.0.99. (in target 'Firebase' from project 'Pods')

Encountered error while building for device.

解决方法

检查错误输出的这一部分

/Users/rushabhshah/Flutter/flutter/packages/flutter_tools/bin/xcode_backend.sh: No such file or directory
    Command PhaseScriptExecution failed with a nonzero exit code

您使用绝对路径/Users/rushabhshah,并且该路径在CI环境中不存在

,

我不确定您是使用UI还是.yaml文件来构建。如果您使用的是.yaml,请确保在构建步骤之前输入Spring Tool Suite 4 Version: 4.8.0.RELEASE Build Id: 202009151856

,

从构建设置文件中删除硬编码路径。
转到目标 - 构建设置 - 在用户定义的部分 - 将 FLUTTER_ROOTFLUTTER_FRAMEWORK_DIR 设置为空,即删除硬编码路径
然后推送带有这些更改的代码。

代码魔术成功生成构建。