flutter - 升级颤振后颤振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.
解决方案
Hkm Sadek我最近遇到了同样的问题,我得到的解决方案是更新项目中的一些依赖项。
删除这些文件 Podfile、Podfile.lock、pubspec.lock:
rm ios/podfile
rm ios/podfile.lock
rm pubspec.lock
最后删除Pods
文件夹并执行以下命令:
flutter clean
pod init
pod install
再次运行
推荐阅读
- python - Python json.loads 错误 json.decoder.JSONDecodeError:
- python - Pandas:将列名的子集转换为值
- javascript - 带有字符串的普通图像源 url 与使用 URL.createObjectURL 有什么区别?
- google-apps-script - 如何让 Google Web App 重定向到表格中的特定单元格
- r - glht 和 emmeans 为 R 中的不平衡数据集返回疯狂的紧凑字母
- r - 如何重新编码增长曲线的年份值?--一种更好的方法
- javascript - 使用闭包时遇到问题
- python - 根据条件安装依赖项
- javascript - 如何使用 Prisma 2 实现社交媒体“关注提要”查询?
- python - 熊猫:找到最近的高点(OHLC)