【问题标题】:How to solve failed flutter app build failing on iOS?如何解决 iOS 上失败的 Flutter 应用构建失败?
【发布时间】:2021-11-08 21:06:27
【问题描述】:

我已将 Firebase Core 和 Auth pubs 添加到我的项目中。之后,我无法在 iOS 上运行我的项目并遇到几个错误,我试图修复这些错误。我决定目前从我的项目中删除 firebase 代码,但仍然出现错误。这是错误堆栈:ptyLogDelegate ^ /Users/mari/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_ffmpeg-0.4.2/ios/Classes/EmptyLogDelegate.m:25:17: note: add stubs for missing protocol requirements @implementation EmptyLogDelegate ^ 1 warning generated. /Users/mari/development/Projects/I-m-In/ios/Pods/VK-ios-sdk/library/Source/VKSdk.m:184:40: warning: 'UIApplicationOpenURLOptionUniversalLinksOnly' is only available on iOS 10.0 or newer [-Wunguarded-availability] NSDictionary *options = @{ UIApplicationOpenURLOptionUniversalLinksOnly: @NO }; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In module 'UIKit' imported from /Users/mari/development/Projects/I-m-In/ios/Pods/Target Support Files/VK-ios-sdk/VK-ios-sdk-prefix.pch:2: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:536:59: note: 'UIApplicationOpenURLOptionUniversalLinksOnly' has been marked as being introduced in iOS 10.0 here, but the deployment target is iOS 9.0.0 UIKIT_EXTERN UIApplicationOpenExternalURLOptionsKey const UIApplicationOpenURLOptionUniversalLinksOnly API_AVAILABLE(ios(10.0)); ^ /Users/mari/development/Projects/I-m-In/ios/Pods/VK-ios-sdk/library/Source/VKSdk.m:184:40: note: enclose 'UIApplicationOpenURLOptionUniversalLinksOnly' in an @available check to silence this warning NSDictionary *options = @{ UIApplicationOpenURLOptionUniversalLinksOnly: @NO }; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/mari/development/Projects/I-m-In/ios/Pods/VK-ios-sdk/library/Source/VKSdk.m:186:26: warning: 'openURL:options:completionHandler:' is only available on iOS 10.0 or newer [-Wunguarded-availability] [application openURL:urlToOpen options:options completionHandler:^(BOOL success) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In module 'UIKit' imported from /Users/mari/development/Projects/I-m-In/ios/Pods/Target Support Files/VK-ios-sdk/VK-ios-sdk-prefix.pch:2: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:130:1: note: 'openURL:options:completionHandler:' has been marked as being introduced in iOS 10.0 here, but the deployment target is iOS 9.0.0 - (void)openURL:(NSURL*)url options:(NSDictionary<UIApplicationOpenExternalURLOptionsKey, id> *)options completionHandler:(void (^ __nullable)(BOOL success))completion API_AVAILABLE(ios(10.0)) NS_EXTENSION_UNAVAILABLE_IOS(""); ^ /Users/mari/development/Projects/I-m-In/ios/Pods/VK-ios-sdk/library/Source/VKSdk.m:186:26: note: enclose 'openURL:options:completionHandler:' in an @available check to silence this warning [application openURL:urlToOpen options:options completionHandler:^(BOOL success) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 warnings generated. /Users/mari/development/Projects/I-m-In/ios/Pods/VK-ios-sdk/library/Source/Core/VKHTTPOperation.m:329:52: warning: 'initWithRequest:delegate:startImmediately:' is deprecated: first deprecated in iOS 9.0 - Use NSURLSession (see NSURLSession.h) [-Wdeprecated-declarations] self.connection = [[NSURLConnection alloc] initWithRequest:self.request delegate:self startImmediately:NO]; ^ In module 'Foundation' imported from /Users/mari/development/Projects/I-m-In/ios/Pods/VK-ios-sdk/library/Source/Core/VKHTTPOperation.h:26: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLConnection.h:115:1: note: 'initWithRequest:delegate:startImmediately:' has been explicitly marked deprecated here - (nullable instancetype)initWithRequest:(NSURLRequest *)request delegate:(nullable id)delegate startImmediately:(BOOL)startImmediately API_DEPRECATED("Use NSURLSession (see NSURLSession.h)", macos(10.5,10.11), ios(2.0,9.0), tvos(9.0,9.0)) API_UNAVAILABLE(watchos); ^ /Users/mari/development/Projects/I-m-In/ios/Pods/VK-ios-sdk/library/Source/Core/VKHTTPOperation.m:528:150: warning: values of type 'NSUInteger' should not be used as format arguments; add an explicit cast to 'unsigned long' instead [-Wformat] [userInfo setValue:[NSString stringWithFormat:NSLocalizedStringFromTable(@"Expected status code 200, got %d", @"AFNetworking", nil), statusCode] forKey:NSLocalizedDescriptionKey]; ^~~~~~~~ %lu (unsigned long) 2 warnings generated. /Users/mari/development/Projects/I-m-In/ios/Pods/Reachability/Reachability.m:465:63: warning: cast to smaller integer type 'unsigned int' from 'Reachability *' [-Wpointer-to-int-cast] NSStringFromClass([self class]), (unsigned int) self, [self currentReachabilityFlags]]; ^~~~~~~~~~~~~~~~~~~ 1 warning generated. /Users/mari/development/Projects/I-m-In/ios/Pods/DKPhotoGallery/DKPhotoGallery/DKPhotoGalleryContentVC.swift:39:52: warning: using 'class' keyword for protocol inheritance is deprecated; use 'AnyObject' instead internal protocol DKPhotoGalleryContentDataSource: class { ^~~~~ AnyObject /Users/mari/development/Projects/I-m-In/ios/Pods/DKPhotoGallery/DKPhotoGallery/DKPhotoGalleryContentVC.swift:55:50: warning: using 'class' keyword for protocol inheritance is deprecated; use 'AnyObject' instead internal protocol DKPhotoGalleryContentDelegate: class { ^~~~~ AnyObject /Users/mari/development/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-3.0.4/ios/Classes/FilePickerPlugin.m:225:68: warning: implicit conversion from enumeration type 'enum UIImagePickerControllerImageURLExportPreset' to different enumeration type 'enum DKImageExportPresent' [-Wenum-conversion] exportConfiguration.imageExportPreset = allowCompression ? UIImagePickerControllerImageURLExportPresetCompatible : UIImagePickerControllerImageURLExportPresetCurrent; ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/mari/development/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-3.0.4/ios/Classes/FilePickerPlugin.m:225:124: warning: implicit conversion from enumeration type 'enum UIImagePickerControllerImageURLExportPreset' to different enumeration type 'enum DKImageExportPresent' [-Wenum-conversion] exportConfiguration.imageExportPreset = allowCompression ? UIImagePickerControllerImageURLExportPresetCompatible : UIImagePickerControllerImageURLExportPresetCurrent; ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 warnings generated. ../../flutter/.pub-cache/hosted/pub.dartlang.org/photo_view-0.11.1/lib/src/core/photo_view_gesture_detector.dart:106:29: Error: The argument type 'PointerEvent' can't be assigned to the parameter type 'PointerDownEvent'. - 'PointerEvent' is from 'package:flutter/src/gestures/events.dart' ('../../flutter/packages/flutter/lib/src/gestures/events.dart'). - 'PointerDownEvent' is from 'package:flutter/src/gestures/events.dart' ('../../flutter/packages/flutter/lib/src/gestures/events.dart'). c/gestures/events.dart' ('../../flutter/packages/flutter/lib/src/gestures/events.dart'). super.addAllowedPointer(event); ^ ../../flutter/.pub-cache/hosted/pub.dartlang.org/selectable_autolink_text-2.2.0/lib/src/selectable_text.dart:187:63: Error: The argument type 'InlineSpan' can't be assigned to the parameter type 'TextSpan'. - 'InlineSpan' is from 'package:flutter/src/painting/inline_span.dart' ('../../flutter/packages/flutter/lib/src/painting/inline_span.dart'). - 'TextSpan' is from 'package:flutter/src/painting/text_span.dart' ('../../flutter/packages/flutter/lib/src/painting/text_span.dart'). if (HighlightedTextSpan.clearHighlight(renderEditable.text!)) { ^ Failed to package /Users/mari/development/Projects/I-m-In. Command PhaseScriptExecution failed with a nonzero exit code note: Using new build system note: Building targets in parallel note: Planning build note: Analyzing workspace note: Constructing build description note: Build preparation complete note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/FirebaseCoreDiagnostics-framework/FirebaseCoreDiagnostics.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/DKImagePickerController/DKImagePickerController.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/GTMAppAuth/GTMAppAuth.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/FMDB/FMDB.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/FirebaseInstallations-framework/FirebaseInstallations.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/video_thumbnail/video_thumbnail.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/DKPhotoGallery/DKPhotoGallery.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/wakelock/wakelock.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/url_launcher/url_launcher.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/webview_flutter/webview_flutter.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/video_player/video_player.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/FirebaseCore-framework/FirebaseCore.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/sqflite/sqflite.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/shared_preferences/shared_preferences.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/share/share.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/path_provider/path_provider.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/sign_in_with_apple/sign_in_with_apple.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/nanopb-framework/nanopb.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/google_sign_in/google_sign_in.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/fluttertoast/fluttertoast.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/FirebaseAuth-framework/FirebaseAuth.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/image_picker/image_picker.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/flutter_native_timezone/flutter_native_timezone.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/libwebp/libwebp.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/permission_handler/permission_handler.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/flutter_keyboard_visibility/flutter_keyboard_visibility.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/file_picker/file_picker.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/flutter_login_vk/flutter_login_vk.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/flutter_ffmpeg/flutter_ffmpeg.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/camera/camera.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/device_info/device_info.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/connectivity/connectivity.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/Toast/Toast.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/PromisesObjC-framework/FBLPromises.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/Runner.app' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/SwiftyGif/SwiftyGif.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/Pods_Runner.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/Reachability/Reachability.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/GTMSessionFetcher-framework/GTMSessionFetcher.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/GoogleDataTransport-framework/GoogleDataTransport.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/GoogleUtilities-framework/GoogleUtilities.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/AppAuth/AppAuth.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/VK-ios-sdk/VK_ios_sdk.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/SDWebImage/SDWebImage.framework' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/VK-ios-sdk/VKSdkResources.bundle' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/DKPhotoGallery/DKPhotoGallery.bundle' note: Removed stale file '/Users/mari/Library/Developer/Xcode/DerivedData/Runner-cwknnwvrtzgrmtgacemyhfazcsdy/Build/Products/Debug-iphoneos/DKImagePickerController/DKImagePickerController.bundle' Could not build the precompiled application for the device. Exited (sigterm) 我已经尝试了很多次我找到的所有方法,例如 deintegrate and install pods、clear 缓存等等。

【问题讨论】:

    标签: ios xcode flutter dart cocoapods


    【解决方案1】:

    转到你的 ios 文件夹中的 Podfile 并添加

    platform :ios, '10.0'
    

    之后你可能需要删除你的 Podfile.lock 并运行

    cd ios
    pod install
    

    【讨论】:

    • 感谢您的回答,但问题可能是由 Flutter 2.5 版本引起的。我将 id 降级到 2.2.3 并使用了这种方法stackoverflow.com/a/64075795/13111967,所以现在错误消失了。
    猜你喜欢
    • 2021-01-19
    • 1970-01-01
    • 2020-03-16
    • 2020-12-28
    • 2020-08-18
    • 2021-09-13
    • 2020-09-15
    • 2020-06-04
    • 1970-01-01
    相关资源
    最近更新 更多