首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Flutter upgrade 2.0 pub问题

Flutter upgrade 2.0 pub问题
EN

Stack Overflow用户
提问于 2021-03-18 20:12:02
回答 2查看 127关注 0票数 0

在flutter 1.22中,它工作得很好,但当我将flutter项目升级到2.0时,它给了我一些错误,而flutter运行我的依赖:

代码语言:javascript
复制
dependencies:
  flutter:
    sdk: flutter
  keyboard_avoider: #Already UP TO DATE update checked on 28/12/2020
  http: #Already UP TO DATE update checked on 28/12/2020
  connectivity: #old- 0.4.9+5 UP TO DATE update checked on 28/12/2020
  html: #already UP TO DATE update checked on 28/12/2020
  string_validator: #already UP TO DATE update checked on 28/12/2020
  shared_preferences: #old-0.5.12+2 UP TO DATE update checked on 28/12/2020
  simple_animations: #old-1.3.3 UP TO DATE update checked on 28/12/2020 for toast animation
  progress_dialog: # already UP TO DATE update checked on 28/12/2020 for progress dialog can also use for show download contain percentage,update
  device_info: #old-0.4.2+9 UP TO DATE update checked on 28/12/2020
  package_info: #old-0.4.3 UP TO DATE update checked on 28/12/2020
  timeago: #old-2.0.29 UP TO DATE update checked on 28/12/2020
  date_format: #already UP TO DATE update checked on 28/12/2020
  datetime_picker_formfield: #already UP TO DATE update checked on 28/12/2020
  intl: #already UP TO DATE update checked on 28/12/2020
  flutter_multiselect: #already UP TO DATE update checked on 28/12/2020
  flutter_local_notifications: #already UP TO DATE update checked on 28/12/2020
  flutter_picker: #already UP TO DATE update checked on 28/12/2020
  f_logs: #old-1.3.0-alpha-01 UP TO DATE update checked on 28/12/2020
  image_picker: #old-^0.6.5-alpha-01 UP TO DATE update checked on 28/12/2020
  image_cropper: #already UP TO DATE update checked on 28/12/2020
  flutter_uploader: #old-^1.2.0 UP TO DATE update checked on 28/12/2020
  flutter_downloader: #old-^1.4.1 UP TO DATE update checked on 28/12/2020
  provider: #old-^3.1.0+1 UP TO DATE update checked on 28/12/2020
  flutter_email_sender: #old-^3.0.1 UP TO DATE update checked on 28/12/2020
  path_provider: #^2.0.1 #^1.6.24 #old-^1.6.7 UP TO DATE update checked on 28/12/2020
  flutter_full_pdf_viewer: #already UP TO DATE update checked on 28/12/2020
  flutter_archive: #old-1.0.2 UP TO DATE update checked on 28/12/2020
  webview_flutter: #old-0.3.14 UP TO DATE update checked on 28/12/2020
  platform_action_sheet: #already UP TO DATE update checked on 28/12/2020
  get_it: #old- UP TO DATE update checked on 28/12/2020
  url_launcher: #6.0.2 #old- 5.0.3 UP TO DATE update checked on 28/12/2020
  filesize: #already UP TO DATE update checked on 28/12/2020
  contacts_service: #old- 0.3.10 UP TO DATE update checked on 28/12/2020
  permission_handler: #old-4.0.0 UP TO DATE update checked on 28/12/2020
  photo_view: #old-0.9.2 UP TO DATE update checked on 28/12/2020
  flutter_share: #old- 1.0.2+1 UP TO DATE update checked on 28/12/2020
  cached_network_image: #old- 2.3.3 UP TO DATE update checked on 28/12/2020
  flutter_cache_manager: #old-2.0.0 UP TO DATE update checked on 28/12/2020
  flushbar: #old- 1.10.4 UP TO DATE update checked on 28/12/2020
  get: #old- 2.13.0 UP TO DATE update checked on 28/12/2020
  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: #old-0.1.2 UP TO DATE update checked on 28/12/2020
  material_design_icons_flutter: #old-3.4.5045 UP TO DATE update checked on 29/12/2020
  firebase_messaging: #^6.0.16 #6.0.16 alternate version
  firebase_analytics: #old-6.3.0 UP TO DATE update checked on 29/12/2020
  firebase_crashlytics: #^1.0.0 #old-0.1.3+3 UP TO DATE update checked on 29/12/2020
  firebase_auth: #^1.0.1 #^0.16.1 #old-0.18.4+1 UP TO DATE update checked on 29/12/2020
  firebase_core: #^1.0.1 #^0.4.4 #0.5.3
  google_sign_in: #old-4.5.1 UP TO DATE update checked on 29/12/2020
  pull_to_refresh:
  shimmer:
  archive:  #already UP TO DATE update checked on 29/12/2020
  flutter_slidable: #already UP TO DATE update checked on 29/12/2020
  flutter_launcher_icons:
  file_picker: #old-1.9.0 UP TO DATE update checked on 29/12/2020
  percent_indicator: #old-2.1.7+4 UP TO DATE update checked on 29/12/2020
  flutter_section_table_view: #already UP TO DATE update checked on 29/12/2020
  international_phone_input: #already UP TO DATE update checked on 29/12/2020for formating mobile number
  firebase_dynamic_links: #old- 0.6.3 UP TO DATE update checked on 29/12/2020 #for creating dynamic link
  intl_phone_number_input: #old-0.4.6+2 UP TO DATE update checked on 29/12/2020 #for international number input
  flutter_open_whatsapp: #already UP TO DATE update checked on 29/12/2020

错误

代码语言:javascript
复制
Running Xcode build...                                                  
Xcode build done.                                           29.3s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    /Users/siddhant/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/ios/Classes/FirebaseAuthPlugin.m:80:42: error:
    incompatible block pointer types sending 'void (^)(FIRUser *__strong, NSError *__strong)' to parameter of type 'void (^
    _Nullable)(FIRAuthDataResult * _Nullable __strong, NSError * _Nullable __strong)'
                                  completion:^(FIRUser *user, NSError *error) {
                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In module 'FirebaseAuth' imported from
    /Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/Headers/Public/Firebase/Firebase.h:30:
    /Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/FirebaseAuth/FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h:573:
    75: note: passing argument to parameter 'completion' here
                                                    NSError *_Nullable error))completion;
                                                                              ^
    /Users/siddhant/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/ios/Classes/FirebaseAuthPlugin.m:87:42: error:
    incompatible block pointer types sending 'void (^)(FIRUser *__strong, NSError *__strong)' to parameter of type 'void (^
    _Nullable)(FIRAuthDataResult * _Nullable __strong, NSError * _Nullable __strong)'
                                  completion:^(FIRUser *user, NSError *error) {
                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In module 'FirebaseAuth' imported from
    /Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/Headers/Public/Firebase/Firebase.h:30:
    /Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/FirebaseAuth/FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h:573:
    75: note: passing argument to parameter 'completion' here
                                                    NSError *_Nullable error))completion;
                                                                              ^
    /Users/siddhant/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/ios/Classes/FirebaseAuthPlugin.m:96:42: error:
    incompatible block pointer types sending 'void (^)(FIRUser *__strong, NSError *__strong)' to parameter of type 'void (^
    _Nullable)(FIRAuthDataResult * _Nullable __strong, NSError * _Nullable __strong)'
                                  completion:^(FIRUser *user, NSError *error) {
                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In module 'FirebaseAuth' imported from
    /Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/Headers/Public/Firebase/Firebase.h:30:
    /Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/FirebaseAuth/FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h:573:
    75: note: passing argument to parameter 'completion' here
                                                    NSError *_Nullable error))completion;
                                                                              ^
    /Users/siddhant/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/ios/Classes/FirebaseAuthPlugin.m:109:21:
    warning: 'fetchProvidersForEmail:completion:' is deprecated: Please use fetchSignInMethodsForEmail:completion: for Objective-C or
    fetchSignInMethods(forEmail:completion:) for Swift instead. [-Wdeprecated-declarations]
        [[FIRAuth auth] fetchProvidersForEmail:email
                        ^
    In module 'FirebaseAuth' imported from
    /Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/Headers/Public/Firebase/Firebase.h:30:
    /Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/FirebaseAuth/FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h:398:
    5: note: 'fetchProvidersForEmail:completion:' has been explicitly marked deprecated here
        DEPRECATED_MSG_ATTRIBUTE("Please use fetchSignInMethodsForEmail:completion: for Objective-C or "
        ^
    In module 'UIKit' imported from /Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/Target Support
    Files/firebase_auth/firebase_auth-prefix.pch:2:
    In module 'Foundation' imported from
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.1.sdk/System/Library/Frame
    works/UIKit.framework/Headers/UIKit.h:8:
    In module 'CoreFoundation' imported from
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.1.sdk/System/Library/Frame
    works/Foundation.framework/Headers/Foundation.h:6:
    In module 'Darwin' imported from
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.1.sdk/System/Library/Frame
    works/CoreFoundation.framework/Headers/CoreFoundation.h:16:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.1.sdk/usr/include/Availabi
    lityMacros.h:181:64: note: expanded from macro 'DEPRECATED_MSG_ATTRIBUTE'
                #define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
                                                                   ^
    /Users/siddhant/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/ios/Classes/FirebaseAuthPlugin.m:160:52:
    error: incompatible block pointer types sending 'void (^)(FIRUser *__strong, NSError *__strong)' to parameter of type 'void (^
    _Nullable)(FIRAuthDataResult * _Nullable __strong, NSError * _Nullable __strong)'
                                            completion:^(FIRUser *user, NSError *error) {
                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In module 'FirebaseAuth' imported from
    /Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/Headers/Public/Firebase/Firebase.h:30:
    /Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/FirebaseAuth/FirebaseAuth/Sources/Public/FirebaseAuth/FIRUser.h:401:
    73: note: passing argument to parameter 'completion' here
                                                  NSError *_Nullable error))completion;
                                                                            ^
    /Users/siddhant/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/ios/Classes/FirebaseAuthPlugin.m:169:52:
    error: incompatible block pointer types sending 'void (^)(FIRUser *__strong, NSError *__strong)' to parameter of type 'void (^
    _Nullable)(FIRAuthDataResult * _Nullable __strong, NSError * _Nullable __strong)'
                                            completion:^(FIRUser *user, NSError *error) {
                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In module 'FirebaseAuth' imported from
    /Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/Headers/Public/Firebase/Firebase.h:30:
    /Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/FirebaseAuth/FirebaseAuth/Sources/Public/FirebaseAuth/FIRUser.h:401:
    73: note: passing argument to parameter 'completion' here
                                                  NSError *_Nullable error))completion;
                                                                            ^
    /Users/siddhant/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/ios/Classes/FirebaseAuthPlugin.m:176:52:
    error: incompatible block pointer types sending 'void (^)(FIRUser *__strong, NSError *__strong)' to parameter of type 'void (^
    _Nullable)(FIRAuthDataResult * _Nullable __strong, NSError * _Nullable __strong)'
                                            completion:^(FIRUser *user, NSError *error) {
                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In module 'FirebaseAuth' imported from
    /Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/Headers/Public/Firebase/Firebase.h:30:
    /Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/FirebaseAuth/FirebaseAuth/Sources/Public/FirebaseAuth/FIRUser.h:401:
    73: note: passing argument to parameter 'completion' here
                                                  NSError *_Nullable error))completion;
                                                                            ^
    /Users/siddhant/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/ios/Classes/FirebaseAuthPlugin.m:185:52:
    error: incompatible block pointer types sending 'void (^)(FIRUser *__strong, NSError *__strong)' to parameter of type 'void (^
    _Nullable)(FIRAuthDataResult * _Nullable __strong, NSError * _Nullable __strong)'
                                            completion:^(FIRUser *user, NSError *error) {
                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In module 'FirebaseAuth' imported from
    /Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/Headers/Public/Firebase/Firebase.h:30:
    /Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/FirebaseAuth/FirebaseAuth/Sources/Public/FirebaseAuth/FIRUser.h:401:
    73: note: passing argument to parameter 'completion' here
                                                  NSError *_Nullable error))completion;
                                                                            ^
    /Users/siddhant/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/ios/Classes/FirebaseAuthPlugin.m:276:42:
    error: incompatible block pointer types sending 'void (^)(FIRUser *__strong, NSError *__strong)' to parameter of type 'void (^
    _Nullable)(FIRAuthDataResult * _Nullable __strong, NSError * _Nullable __strong)'
                                  completion:^(FIRUser *user, NSError *error) {
                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In module 'FirebaseAuth' imported from
    /Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/Headers/Public/Firebase/Firebase.h:30:
    /Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/FirebaseAuth/FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h:573:
    75: note: passing argument to parameter 'completion' here
                                                    NSError *_Nullable error))completion;
                                                                              ^
    /Users/siddhant/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/ios/Classes/FirebaseAuthPlugin.m:300:62:
    warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
      userData[@"lastSignInTimestamp"] = [NSNumber numberWithInt:lastSignInDate];
                                         ~                       ^~~~~~~~~~~~~~
    2 warnings and 8 errors generated.
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.

我已经尝试删除podFile、Podlock、Pod和.symlinks。甚至升级了cocapods。跑得扑腾的医生也给了我所有的扁虫。如有任何建议,请提前告诉我,谢谢你的帮助。

EN

回答 2

Stack Overflow用户

发布于 2021-03-18 20:28:31

回滚到1.22并等待Flutter 2上的稳定版本。Flutter 2引入了Null Safety,这可能会导致基于Flutter 1.22的项目出现问题。

票数 0
EN

Stack Overflow用户

发布于 2021-03-18 21:18:44

请使用firebase相关的所有版本兼容。如果使用firebase_auth: ^0.20.0+1,则使用firebase_dynamic_links: ^0.7.0+1 firebase_messaging: ^8.0.0-dev.12 firebase_storage: ^7.0.0 firebase_core : ^0.7.0

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66690866

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档