首页 > 解决方案 > 升级颤振后颤振xcode构建失败

问题描述

我的应用运行良好,我将颤振升级到Flutter 1.20.2 and Dart 2.9.1. 现在,如果我运行我的颤振项目,我会收到一条很大的错误消息。

贝娄是错误。

            Launching lib/main.dart on iPhone 11 in debug mode...
        Running Xcode build...                                                  
                                                        
        Xcode build done.                                           14.5s
        Failed to build iOS app
        Error output from Xcode build:
        ↳
            ** BUILD FAILED **


        Xcode's output:
        ↳
            12 warnings generated.
            /Users/mdzainalabedin/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-2.2.0+1/ios/Classes/FirebaseMessagingPlugin.m:99:11: warning: incompatible integer to pointer conversion initializing 'BOOL *' (aka 'bool *') with an expression of type 'BOOL' (aka 'bool')
            [-Wint-conversion]
                BOOL *value = [[FIRMessaging messaging] isAutoInitEnabled];
                    ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            /Users/mdzainalabedin/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-2.2.0+1/ios/Classes/FirebaseMessagingPlugin.m:174:75: warning: 'token' is deprecated: Use instanceIDWithHandler: instead. [-Wdeprecated-declarations]
            [_channel invokeMethod:@"onToken" arguments:[[FIRInstanceID instanceID] token]];
                                                                                    ^
            In file included from /Users/mdzainalabedin/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-2.2.0+1/ios/Classes/FirebaseMessagingPlugin.m:7:
            In file included from /Users/mdzainalabedin/padelmatchv2/ios/Pods/Headers/Private/Firebase/Firebase.h:46:
            In file included from /Users/mdzainalabedin/padelmatchv2/ios/Pods/Headers/Private/FirebaseInstanceID/FirebaseInstanceID.h:17:
            /Users/mdzainalabedin/padelmatchv2/ios/Pods/Headers/Private/FirebaseInstanceID/FIRInstanceID.h:217:30: note: 'token' has been explicitly marked deprecated here
            - (nullable NSString *)token __deprecated_msg("Use instanceIDWithHandler: instead.");
                                        ^
            In module 'Foundation' imported from /Users/mdzainalabedin/padelmatchv2/ios/Pods/Headers/Private/FirebaseCore/FIRAnalyticsConfiguration.h:17:
            In module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
            In module 'Darwin' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:
            /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/cdefs.h:191:48: note: expanded from macro '__deprecated_msg'
                    #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                                ^
            2 warnings generated.
            lib/screens/eventDetailsScreen/eventDetails.dart:90:28: Error: Too many positional arguments: 1 allowed, but 2 found.
            Try removing the extra positional arguments.
                pr = new ProgressDialog(context, ProgressDialogType.Normal);
                                    ^
            ../.pub-cache/hosted/pub.dartlang.org/progress_dialog-1.2.4/lib/progress_dialog.dart:40:3: Context: Found this candidate, but the arguments don't match.
            ProgressDialog(BuildContext context,
            ^^^^^^^^^^^^^^
            lib/screens/eventDetailsScreen/eventDetails.dart:91:8: Error: The method 'setMessage' isn't defined for the class 'ProgressDialog'.
            - 'ProgressDialog' is from 'package:progress_dialog/progress_dialog.dart' ('../.pub-cache/hosted/pub.dartlang.org/progress_dialog-1.2.4/lib/progress_dialog.dart').
            Try correcting the name to the name of an existing method, or defining a method named 'setMessage'.
                pr.setMessage(FlutterI18n.translate(context, "Please wait"));
                ^^^^^^^^^^

            Command PhaseScriptExecution failed with a nonzero exit code
            note: Using new build system
            note: Planning build
            note: Constructing build description
            warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 6.0, but the range of supported deployment target versions is 8.0 to 13.2.99. (in target 'GoogleUtilities' from project 'Pods')
            warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 4.3, but the range of supported deployment target versions is 8.0 to 13.2.99. (in target 'image_picker' from project 'Pods')
            warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 7.0, but the range of supported deployment target versions is 8.0 to 13.2.99. (in target 'Protobuf' from project 'Pods')
            warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 6.0, but the range of supported deployment target versions is 8.0 to 13.2.99. (in target 'GoogleAppMeasurement' from project 'Pods')
            warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 6.0, but the range of supported deployment target versions is 8.0 to 13.2.99. (in target 'Reachability' from project 'Pods')
            warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 4.3, but the range of supported deployment target versions is 8.0 to 13.2.99. (in target 'FMDB' from project 'Pods')
            warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 4.3, but the range of supported deployment target versions is 8.0 to 13.2.99. (in target 'nanopb' from project 'Pods')

        Could not build the application for the simulator.
        Error launching application on iPhone 11.

标签: flutter

解决方案


Hkm Sadek我最近遇到了同样的问题,我得到的解决方案是更新项目中的一些依赖项。

删除这些文件 Podfile、Podfile.lock、pubspec.lock:

rm ios/podfile
rm ios/podfile.lock
rm pubspec.lock

最后删除Pods文件夹并执行以下命令:

flutter clean
pod init
pod install

再次运行


推荐阅读