使用 Codemagic 构建 iOS 失败 [与 Xcode 配合良好]

问题描述 投票:0回答:4

构建在 Xcode 中成功完成,但是当我使用 code magic 构建它时,它失败了。以下是我的构建失败日志。

下面是我从 code magic 收到的输出。它显示了 firebase 和 Audience Network 插件中的一些错误,但它不是在 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, 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))
                                                               ^
    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, 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 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.
ios continuous-delivery codemagic
4个回答
1
投票

检查这部分错误输出

/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环境中不存在


1
投票

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

Code magic 生成构建成功。


0
投票

我不确定您是使用 UI 还是 .yaml 文件来构建。如果您使用 .yaml,请确保在构建步骤之前有

flutter packages pub get


0
投票

我也有同样的问题。就我而言,

codemagic.yaml
文件中缺少此脚本:

xcode-project use-profiles
© www.soinside.com 2019 - 2024. All rights reserved.