首页 > 解决方案 > Codemagic IOS 构建 - 无法构建 iOS 应用程序 - 是什么原因?

问题描述

我正在尝试为 IOS 构建我的应用程序。

我有没有 IOS 开发工具的 windows + flutter/Dart。

使用 Codemagic 为 Android 版本和简单的 IOS 签名应用程序构建没有问题。IPHONEOS_DEPLOYMENT_TARGET = 12.0;

主应用程序的附加 Codemagic 构建日志

警告是失败的原因吗?

他们的主要问题是什么?

> flutter build ipa --release --export-options-plist /Users/builder/export_options.plist -t lib/main_app1.dart

Running "flutter pub get" in clone...                           
 1,418ms

Archiving com.xxx...
Upgrading contents.xcworkspacedata

Automatically signing iOS for device deployment using specified development team in Xcode project: xxxxx

Running pod install...                                          
   20.3s

Running Xcode build...                                          

Xcode archive done.                                         108.4s

Failed to build iOS app
Error output from Xcode build:
↳
    ** ARCHIVE FAILED **


Xcode's output:
↳
    2 warnings generated.
    /Users/builder/programs/flutter_2_0_3/.pub-cache/hosted/pub.dartlang.org/geolocator-7.0.1/ios/Classes/GeolocatorPlugin.m:199:11: warning: 'openURL:' is deprecated: first deprecated in iOS 10.0 [-Wdeprecated-declarations]
              openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
              ^~~~~~~
              openURL:options:completionHandler:
    In module 'UIKit' imported from /Users/builder/clone/ios/Pods/Target Support Files/geolocator/geolocator-prefix.pch:2:
    /Applications/Xcode-12.4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:123:1: note: 'openURL:' has been explicitly marked deprecated here
    - (BOOL)openURL:(NSURL*)url API_DEPRECATED_WITH_REPLACEMENT("openURL:options:completionHandler:", ios(2.0, 10.0)) NS_EXTENSION_UNAVAILABLE_IOS("");
    ^
    1 warning generated.
    /Users/builder/programs/flutter_2_0_3/.pub-cache/hosted/pub.dartlang.org/flutter_phone_direct_caller-1.0.1/ios/Classes/FlutterPhoneDirectCallerPlugin.m:24:22: warning: 'stringByAddingPercentEscapesUsingEncoding:' is deprecated: first deprecated in iOS 9.0 - Use -stringByAddingPercentEncodingWithAllowedCharacters: instead, which always uses the recommended UTF-8 encoding, and which encodes for a specific URL component or subcomponent since each URL component or subcomponent has different rules for what characters are valid. [-Wdeprecated-declarations]
        number = [number stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
                         ^
    In module 'UIKit' imported from /Users/builder/clone/ios/Pods/Target Support Files/flutter_phone_direct_caller/flutter_phone_direct_caller-prefix.pch:2:
    In module 'Foundation' imported from /Applications/Xcode-12.4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:
    /Applications/Xcode-12.4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h:595:1: note: 'stringByAddingPercentEscapesUsingEncoding:' has been explicitly marked deprecated here
    - (nullable NSString *)stringByAddingPercentEscapesUsingEncoding:(NSStringEncoding)enc API_DEPRECATED("Use -stringByAddingPercentEncodingWithAllowedCharacters: instead, which always uses the recommended UTF-8 encoding, and which encodes for a specific URL component or subcomponent since each URL component or subcomponent has different rules for what characters are valid.", macos(10.0,10.11), ios(2.0,9.0), watchos(2.0,2.0), tvos(9.0,9.0));
    ^
    /Users/builder/programs/flutter_2_0_3/.pub-cache/hosted/pub.dartlang.org/flutter_phone_direct_caller-1.0.1/ios/Classes/FlutterPhoneDirectCallerPlugin.m:30:51: warning: 'openURL:' is deprecated: first deprecated in iOS 10.0 [-Wdeprecated-declarations]
        } else if(![[UIApplication sharedApplication] openURL:[NSURL URLWithString:number]]) {
                                                      ^~~~~~~
                                                      openURL:options:completionHandler:
    In module 'UIKit' imported from /Users/builder/clone/ios/Pods/Target Support Files/flutter_phone_direct_caller/flutter_phone_direct_caller-prefix.pch:2:
    /Applications/Xcode-12.4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:123:1: note: 'openURL:' has been explicitly marked deprecated here
    - (BOOL)openURL:(NSURL*)url API_DEPRECATED_WITH_REPLACEMENT("openURL:options:completionHandler:", ios(2.0, 10.0)) NS_EXTENSION_UNAVAILABLE_IOS("");
    ^
    2 warnings generated.
    /Users/builder/programs/flutter_2_0_3/.pub-cache/hosted/pub.dartlang.org/audioplayers-0.13.6/ios/Classes/AudioplayersPlugin.m:77:33: warning: incompatible pointer types sending 'FlutterEngine *' to parameter of type 'NSObject<FlutterBinaryMessenger> * _Nonnull' [-Wincompatible-pointer-types]
                    binaryMessenger:_headlessEngine];
                                    ^~~~~~~~~~~~~~~
    In module 'Flutter' imported from /Users/builder/programs/flutter_2_0_3/.pub-cache/hosted/pub.dartlang.org/audioplayers-0.13.6/ios/Classes/AudioplayersPlugin.h:1:
    /Users/builder/programs/flutter_2_0_3/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-armv7_arm64/Flutter.framework/Headers/FlutterChannels.h:178:74: note: passing argument to parameter 'messenger' here
                          binaryMessenger:(NSObject<FlutterBinaryMessenger>*)messenger;
                                                                             ^
    /Users/builder/programs/flutter_2_0_3/.pub-cache/hosted/pub.dartlang.org/audioplayers-0.13.6/ios/Classes/AudioplayersPlugin.m:384:66: warning: 'initWithImage:' is deprecated: first deprecated in iOS 10.0 - Use -initWithBoundsSize:requestHandler: [-Wdeprecated-declarations]
          MPMediaItemArtwork *albumArt = [[MPMediaItemArtwork alloc] initWithImage: artworkImage];
                                                                     ^
    In module 'MediaPlayer' imported from /Users/builder/programs/flutter_2_0_3/.pub-cache/hosted/pub.dartlang.org/audioplayers-0.13.6/ios/Classes/AudioplayersPlugin.m:4:
    /Applications/Xcode-12.4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaItem.h:240:1: note: 'initWithImage:' has been explicitly marked deprecated here
    - (instancetype)initWithImage:(UIImage *)image MP_DEPRECATED("Use -initWithBoundsSize:requestHandler:", ios(5.0, 10.0));
    ^
    /Users/builder/programs/flutter_2_0_3/.pub-cache/hosted/pub.dartlang.org/audioplayers-0.13.6/ios/Classes/AudioplayersPlugin.m:607:25: warning: 'seekToTime:' is deprecated: first deprecated in iOS 11.0 - Use -seekToTime:completionHandler:, passing nil for the completionHandler if you don't require notification of completion [-Wdeprecated-declarations]
      [[player currentItem] seekToTime:time];
                            ^
    In module 'AVFoundation' imported from /Users/builder/programs/flutter_2_0_3/.pub-cache/hosted/pub.dartlang.org/audioplayers-0.13.6/ios/Classes/AudioplayersPlugin.m:5:
    /Applications/Xcode-12.4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItem.h:809:1: note: 'seekToTime:' has been explicitly marked deprecated here
    - (void)seekToTime:(CMTime)time API_DEPRECATED("Use -seekToTime:completionHandler:, passing nil for the completionHandler if you don't require notification of completion", macos(10.7, 10.13), ios(4.0, 11.0), tvos(9.0, 11.0)) API_UNAVAILABLE(watchos);
    ^
    3 warnings generated.
    ld: warning: Could not find or use auto-linked library 'swiftCoreFoundation'
    ld: warning: Could not find or use auto-linked library 'swiftCompatibility50'
    ld: warning: Could not find or use auto-linked library 'swiftCore'
    ld: warning: Could not find or use auto-linked library 'swiftQuartzCore'
    ld: warning: Could not find or use auto-linked library 'swiftCoreGraphics'
    ld: warning: Could not find or use auto-linked library 'swiftDarwin'
    ld: warning: Could not find or use auto-linked library 'swiftUIKit'
    ld: warning: Could not find or use auto-linked library 'swiftFoundation'
    ld: warning: Could not find or use auto-linked library 'swiftCompatibility51'
    ld: warning: Could not find or use auto-linked library 'swiftObjectiveC'
    ld: warning: Could not find or use auto-linked library 'swiftCoreMedia'
    ld: warning: Could not find or use auto-linked library 'swiftDispatch'
    ld: warning: Could not find or use auto-linked library 'swiftMetal'
    ld: warning: Could not find or use auto-linked library 'swiftCompatibilityDynamicReplacements'
    ld: warning: Could not find or use auto-linked library 'swiftCor
eImage'
    ld: warning: Could not find or use auto-linked library 'swiftCoreAudio'
    Undefined symbols for architecture arm64:
      "__swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements", referenced from:
          __swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements_$_telephony in libtelephony.a(SwiftTelephonyPlugin.o)
         (maybe you meant: __swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements_$_telephony)
      "__swift_FORCE_LOAD_$_swiftCompatibility51", referenced from:
          __swift_FORCE_LOAD_$_swiftCompatibility51_$_telephony in libtelephony.a(SwiftTelephonyPlugin.o)
         (maybe you meant: __swift_FORCE_LOAD_$_swiftCompatibility51_$_telephony)
      "__swift_FORCE_LOAD_$_swiftCompatibility50", referenced from:
          __swift_FORCE_LOAD_$_swiftCompatibility50_$_telephony in libtelephony.a(SwiftTelephonyPlugin.o)
         (maybe you meant: __swift_FORCE_LOAD_$_swiftCompatibility50_$_telephony)
      "__swift_FORCE_LOAD_$_swiftCoreAudio", referenced from:
          __swift_FORCE_LOAD_$_swiftCoreAudio_$_telephony in libtelephony.a(SwiftTelephonyPlugin.o)
         (maybe you meant: __swift_FORCE_LOAD_$_swiftCoreAudio_$_telephony)
      "type metadata for Swift.String", referenced from:
          telephony.SwiftTelephonyPlugin.handle(_: __C.FlutterMethodCall, result: (Any?) -> ()) -> () in libtelephony.a(SwiftTelephonyPlugin.o)
          function signature specialization <Arg[0] = Dead, Arg[1] = Dead, Arg[2] = Owned To Guaranteed> of function signature specialization <Arg[1] = [Closure Propagated : reabstraction thunk helper from @escaping @callee_unowned @convention(block) (@unowned Swift.Optional<Swift.AnyObject>) -> () to @escaping @callee_guaranteed (@in_guaranteed Swift.Optional<Any>) -> (), Argument Types : [@escaping @callee_unowned @convention(block) (@unowned Swift.AnyObject?) -> ()]> of telephony.SwiftTelephonyPlugin.handle(_: __C.FlutterMethodCall, result: (Any?) -> ()) -> () in libtelephony.a(SwiftTelephonyPlugin.o)
      "_swift_bridgeObjectRelease", referenced from:
          telephony.SwiftTelephonyPlugin.handle(_: __C.FlutterMethodCall, result: (Any?) -> ()) -> () in libtelephony.a(SwiftTelephonyPlugin.o)
          function signature specialization <Arg[0] = Dead, Arg[1] = Dead, Arg[2] = Owned To Guaranteed> of function signature specialization <Arg[1] = [Closure Propagated : reabstraction thunk helper from @escaping @callee_unowned @convention(block) (@unowned Swift.Optional<Swift.AnyObject>) -> () to @escaping @callee_guaranteed (@in_guaranteed Swift.Optional<Any>) -> (), Argument Types : [@escaping @callee_unowned @convention(block) (@unowned Swift.AnyObject?) -> ()]> of telephony.SwiftTelephonyPlugin.handle(_: __C.FlutterMethodCall, result: (Any?) -> ()) -> () in libtelephony.a(SwiftTelephonyPlugin.o)
      "__swift_FORCE_LOAD_$_swiftCoreMedia", referenced from:
          __swift_FORCE_LOAD_$_swiftCoreMedia_$_telephony in libtelephony.a(SwiftTelephonyPlugin.o)
         (maybe you meant: __swift_FORCE_LOAD_$_swiftCoreMedia_$_telephony)
      "__swift_FORCE_LOAD_$_swiftCoreImage", referenced from:
          __swift_FORCE_LOAD_$_swiftCoreImage_$_telephony in libtelephony.a(SwiftTelephonyPlugin.o)
         (maybe you meant: __swift_FORCE_LOAD_$_swiftCoreImage_$_telephony)
      "__swift_FORCE_LOAD_$_swiftCoreGraphics", referenced from:
          __swift_FORCE_LOAD_$_swiftCoreGraphics_$_telephony in libtelephony.a(SwiftTelephonyPlugin.o)
         (maybe you meant: __swift_FORCE_LOAD_$_swiftCoreGraphics_$_telephony)
      "__swift_FORCE_LOAD_$_swiftQuartzCore", referenced from:
          __swift_FORCE_LOAD_$_swiftQuartzCore_$_telephony in libtelephony.a(SwiftTelephonyPlugin.o)
         (maybe you meant: __swift_FORCE_LOAD_$_swiftQuartzCore_$_telephony)
      "_swift_release", referenced from:
          ___swift_destroy_boxed_opaque_existential_0 in libtelephony.a(SwiftTelephonyPlugin.o)
      "__swift_FORCE_LOAD_$_swiftDispatch", referenced from:
          __swift_FORCE_LOAD_$_swiftDispatch_$_telephony in libtelephony.a(SwiftTelephonyPlugin.o)
         (maybe you meant: __swift_FORCE_LOAD_$_swiftDispatch_$_telephony)
      "__swift_FORCE_LOAD_$_swiftCoreFoundation", referenced from:
          __swift_FORCE_LOAD_$_swiftCoreFoundation_$_telephony in libtelephony.a(SwiftTelephonyPlugin.o)
         (maybe you meant: __swift_FORCE_LOAD_$_swiftCoreFoundation_$_telephony)
      "_swift_getInitializedObjCClass", referenced from:
          static telephony.SwiftTelephonyPlugin.register(with: __C.FlutterPluginRegistrar) -> () in libtelephony.a(SwiftTelephonyPlugin.o)
          type metadata accessor for telephony.SwiftTelephonyPlugin in libtelephony.a(SwiftTelephonyPlugin.o)
          @objc static telephony.SwiftTelephonyPlugin.register(with: __C.FlutterPluginRegistrar) -> () in libtelephony.a(SwiftTelephonyPlugin.o)
          telephony.SwiftTelephonyPlugin.handle(_: __C.FlutterMethodCall, result: (Any?) -> ()) -> () in libtelephony.a(SwiftTelephonyPlugin.o)
          function signature specialization <Arg[0] = Dead, Arg[1] = Dead, Arg[2] = Owned To Guaranteed> of function signature specialization <Arg[1] = [Closure Propagated : reabstraction thunk helper from @escaping @callee_unowned @convention(block) (@unowned Swift.Optional<Swift.AnyObject>) -> () to @escaping @callee_guaranteed (@in_guaranteed Swift.Optional<Any>) -> (), Argument Types : [@escaping @callee_unowned @convention(block) (@unowned Swift.AnyObject?) -> ()]> of telephony.SwiftTelephonyPlugin.handle(_: __C.FlutterMethodCall, result: (Any?) -> ()) -> () in libtelephony.a(SwiftTelephonyPlugin.o)
      "__swift_FORCE_LOAD_$_swiftFoundation", referenced from:
          __swift_FORCE_LOAD_$_swiftFoundation_$_telephony in libtelephony.a(SwiftTelephonyPlugin.o)
         (maybe you meant: __swift_FORCE_LOAD_$_swiftFoundation_$_telephony)
      "value witness table for Builtin.UnknownObject", referenced from:
          full type metadata for telephony.SwiftTelephonyPlugin in libtelephony.a(SwiftTelephonyPlugin.o)
      "(extension in Foundation):Swift.String._bridgeToObjectiveC() -> __C.NSString", referenced from:
          static telephony.SwiftTelephonyPlugin.register(with: __C.FlutterPluginRegistrar) -> () in libtelephony.a(SwiftTelephonyPlugin.o)
          @objc static telephony.SwiftTelephonyPlugin.register(with: __C.FlutterPluginRegistrar) -> () in libtelephony.a(SwiftTelephonyPlugin.o)
      "Swift._bridgeAnythingToObjectiveC(A) -> Swift.AnyObject", referenced from:
          function signature specialization <Arg[0] = Dead, Arg[1] = Dead, Arg[2] = Owned To Guaranteed> of function signature specialization <Arg[1] = [Closure Propagated : reabstraction thunk helper from @escaping @callee_unowned @convention(block) (@unowned Swift.Optional<Swift.AnyObject>) -> () to @escaping @callee_guaranteed (@in_guaranteed Swift.Optional<Any>) -> (), Argument Types : [@escaping @callee_unowned @convention(block) (@unowned Swift.AnyObject?) -> ()]> of telephony.SwiftTelephonyPlugin.handle(_: __C.FlutterMethodCall, result: (Any?) -> ()) -> () in libtelephony.a(SwiftTelephonyPlugin.o)
      "_swift_getTypeByMangledNameInContext", referenced from:
          ___swift_instantiateConcreteTypeFromMangledName in libtelephony.a(SwiftTelephonyPlugin.o)
      "__swift_FORCE_LOAD_$_swiftUIKit", referenced from:
          __swift_FORCE_LOAD_$_swiftUIKit_$_telephony in libtelephony.a(SwiftTelephonyPlugin.o)
         (maybe you meant: __swift_FORCE_LOAD_$_swiftUIKit_$_telephony)
      "Swift.String.append(Swift.String) -> ()", referenced from:
          telephony.SwiftTelephonyPlugin.handle(_: __C.FlutterMethodCall, result: (Any?) -> ()) -> () in libtelephony.a(SwiftTelephonyPlugin.o)
          function signature specialization <Arg[0] = Dead, Arg[1] = Dead, Arg[2] = Owned To Guaranteed> of function signature specialization <Arg[1] = [Closure Propagated : reabstraction thunk helper from @escaping @callee_unowned @convention(block) (@unowned Swift.Optional<Swift.AnyObject>) -> () to @escaping @callee_guaranteed (@in_guaranteed Swift.Optional<Any>) -> (), Argument Types : [@escaping @callee_unowned @convention(block) (@unowned Swift.AnyObject?) -> ()]> of telephony.SwiftTelephonyPlugin.handle(_: __C.FlutterMethodCall, result: (Any?) -> ()) -> () in libtelephony.a(SwiftTelephonyPlugin.o)
      "__swift_FORCE_LOAD_$_swiftDarwin", referenced from:
          __swift_FORCE_LOAD_$_swiftDarwin_$_telephony in libtelephony.a(SwiftTelephonyPlugin.o)
         (maybe you meant: __swift_FORCE_LOAD_$_swiftDarwin_$_telephony)
      "_swift_unknownObjectRelease", referenced from:
          static telephony.SwiftTelephonyPlugin.register(with: __C.FlutterPluginRegistrar) -> () in libtelephony.a(SwiftTelephonyPlugin.o)
          @objc static telephony.SwiftTelephonyPlugin.register(with: __C.FlutterPluginRegistrar) -> () in libtelephony.a(SwiftTelephonyPlugin.o)
          function signature specialization <Arg[0] = Dead, Arg[1] = Dead, Arg[2] = Owned To Guaranteed> of function signature specialization <Arg[1] = [Closure Propagated : reabstraction thunk helper from @escaping @callee_unowned @convention(block) (@unowned Swift.Optional<Swift.AnyObject>) -> () to @escaping @callee_guaranteed (@in_guaranteed Swift.Optional<Any>) -> (), Argument Types : [@escaping @callee_unowned @convention(block) (@unowned Swift.AnyObject?) -> ()]> of telephony.SwiftTelephonyPlugin.handle(_: __C.FlutterMethodCall, result: (Any?) -> ()) -> () in libtelephony.a(SwiftTelephonyPlugin.o)
      "static (extension in Foundation):Swift.String._unconditionallyBridgeFromObjectiveC(__C.NSString?) -> Swift.String", referenced from:
          telephony.SwiftTelephonyPlugin.handle(_: __C.FlutterMethodCall, result: (Any?) -> ()) -> () in libtelephony.a(SwiftTelephonyPlugin.o)
          function signature specialization <Arg[0] = Dead, Arg[1] = Dead, Arg[2] = Owned To Guaranteed> of function signature specialization <Arg[1] = [Closure Propagated : reabstraction thunk helper from @escaping @callee_unowned @convention(block) (@unowned Swift.Optional<Swift.AnyObject>) -> () to @escaping @callee_guaranteed (@in_guaranteed Swift.Optional<Any>) -> (), Argument Types : [@escaping @callee_unowned @convention(block) (@unowned Swift.AnyObject?) -> ()]> of telephony.SwiftTelephonyPlugin.handle(_: __C.FlutterMethodCall, result: (Any?) -> ()) -> () in libtelephony.a(SwiftTelephonyPlugin.o)
      "__swift_FORCE_LOAD_$_swiftMetal", referenced from:
          __swift_FORCE_LOAD_$_swiftMetal_$_telephony in libtelephony.a(SwiftTelephonyPlugin.o)
         (maybe you meant: __swift_FORCE_LOAD_$_swiftMetal_$_telephony)
      "_swift_unknownObjectRetain", referenced from:
          @objc static telephony.SwiftTelephonyPlugin.register(with: __C.FlutterPluginRegistrar) -> () in libtelephony.a(SwiftTelephonyPlugin.o)
      "__swift_FORCE_LOAD_$_swiftObjectiveC", referenced from:
          __swift_FORCE_LOAD_$_swiftObjectiveC_$_telephony in libtelephony.a(SwiftTelephonyPlugin.o)
         (maybe you meant: __swift_FORCE_LOAD_$_swiftObjectiveC_$_telephony)
    ld: symbol(s) not found for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
    warning: Provisioning profile "com XXX ios_app_development xxxxxxx" for "Runner" contains entitlements that aren't in the entitlements file: com.apple.developer.devicecheck.appattest-environment. To use these entitlements, add them to your entitlements file. Otherwise, remove unused entitlements from your provisioning profile. (in target 'Runner' from project 'Runner')

Encountered error while archiveing for device.


Build failed :|
Failed to build for iOS

标签: iosflutterdartbuildcodemagic

解决方案


我认为您应该尝试在您的 xcode 项目中创建一个空文件,例如 BridgeHeader.swift,如果您手动创建此文件,只需添加

import Foundation

如果这不起作用,请尝试确保您拥有开发人员工具/工具链


推荐阅读