的Flutter和Firebase:任务’:firebase_auth:compileDebugJavaWithJavac’的执行失败

的Flutter和Firebase:任务’:firebase_auth:compileDebugJavaWithJavac’的执行失败,第1张

概述我正在尝试构建Flutter应用程序以与Firebase进行交互.我已将google-services.json放在正确的位置.但是,每当我尝试构建Android应用程序时,我都会得到以下运行日志:Running 'flutter packages get' in smart_diet_flutter... 2.6s Launching l

我正在尝试构建Flutter应用程序以与Firebase进行交互.我已将Google-services.Json放在正确的位置.但是,每当我尝试构建Android应用程序时,我都会得到以下运行日志:

Running "Flutter packages get" in smart_dIEt_Flutter...          2.6sLaunching lib\main.dart on ONEPLUS A6003 in deBUG mode...Initializing gradle...Resolving dependencIEs...Gradle task 'assembleDeBUG'...registerResGeneratingTask is deprecated,use registerGeneratedResFolders(fileCollection)registerResGeneratingTask is deprecated,use registerGeneratedResFolders(fileCollection)C:\Flutter\.pub-cache\hosted\pub.dartlang.org\firebase_auth-0.8.0\androID\src\main\java\io\Flutter\plugins\firebaseauth\FirebaseAuthPlugin.java:9: error: cannot find symbolimport androIDx.annotation.NonNull;                          ^  symbol:   class NonNull  location: package androIDx.annotationC:\Flutter\.pub-cache\hosted\pub.dartlang.org\firebase_auth-0.8.0\androID\src\main\java\io\Flutter\plugins\firebaseauth\FirebaseAuthPlugin.java:10: error: cannot find symbolimport androIDx.annotation.Nullable;                          ^  symbol:   class Nullable  location: package androIDx.annotationC:\Flutter\.pub-cache\hosted\pub.dartlang.org\firebase_auth-0.8.0\androID\src\main\java\io\Flutter\plugins\firebaseauth\FirebaseAuthPlugin.java:638: error: cannot find symbol  private voID reportException(Result result,@Nullable Exception exception) {                                               ^  symbol:   class Nullable  location: class FirebaseAuthPluginC:\Flutter\.pub-cache\hosted\pub.dartlang.org\firebase_auth-0.8.0\androID\src\main\java\io\Flutter\plugins\firebaseauth\FirebaseAuthPlugin.java:550: error: cannot find symbol    public voID onComplete(@NonNull Task<AuthResult> task) {                            ^  symbol:   class NonNull  location: class FirebaseAuthPlugin.SignInCompleteListenerC:\Flutter\.pub-cache\hosted\pub.dartlang.org\firebase_auth-0.8.0\androID\src\main\java\io\Flutter\plugins\firebaseauth\FirebaseAuthPlugin.java:569: error: cannot find symbol    public voID onComplete(@NonNull Task<VoID> task) {                            ^  symbol:   class NonNull  location: class FirebaseAuthPlugin.TaskVoIDCompleteListenerC:\Flutter\.pub-cache\hosted\pub.dartlang.org\firebase_auth-0.8.0\androID\src\main\java\io\Flutter\plugins\firebaseauth\FirebaseAuthPlugin.java:587: error: cannot find symbol    public voID onComplete(@NonNull Task<SignInMethodqueryResult> task) {                            ^  symbol:   class NonNull  location: class FirebaseAuthPlugin.GetSignInMethodsCompleteListenerC:\Flutter\.pub-cache\hosted\pub.dartlang.org\firebase_auth-0.8.0\androID\src\main\java\io\Flutter\plugins\firebaseauth\FirebaseAuthPlugin.java:186: error: cannot find symbol                      public voID onComplete(@NonNull Task<AuthResult> task) {                                              ^  symbol: class NonNullC:\Flutter\.pub-cache\hosted\pub.dartlang.org\firebase_auth-0.8.0\androID\src\main\java\io\Flutter\plugins\firebaseauth\FirebaseAuthPlugin.java:445: error: cannot find symbol              public voID onComplete(@NonNull Task<GetTokenResult> task) {                                      ^  symbol: class NonNullC:\Flutter\.pub-cache\hosted\pub.dartlang.org\firebase_auth-0.8.0\androID\src\main\java\io\Flutter\plugins\firebaseauth\FirebaseAuthPlugin.java:499: error: cannot find symbol          public voID onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {                                          ^  symbol: class NonNullNote: C:\Flutter\.pub-cache\hosted\pub.dartlang.org\firebase_auth-0.8.0\androID\src\main\java\io\Flutter\plugins\firebaseauth\FirebaseAuthPlugin.java uses unchecked or unsafe operations.Note: Recompile with -Xlint:unchecked for details.9 errorsFAILURE: Build Failed with an exception.* What went wrong:Execution Failed for task ':firebase_auth:compileDeBUGJavaWithJavac'.> Compilation Failed; see the compiler error output for details.* Try:Run with --stacktrace option to get the stack trace. Run with --info or --deBUG option to get more log output. Run with --scan to get full insights.* Get more help at https://help.gradle.orgBUILD Failed in 22sFinished with error: Gradle task assembleDeBUG Failed with exit code 1

通过研究,我发现可能需要升级到AndroIDX.我遵循此link来升级我的androID.但是,在尝试构建和运行应用程序时,我仍然遇到相同的错误.

我正在使用InteliJ作为带有抖动项目的IDE,我的pubspec.yaml如下所示:

name: smart_dIEt_Flutterdescription: A new Flutter project.# The following defines the version and build number for your application.# A version number is three numbers separated by dots,like 1.2.43# followed by an optional build number separated by a +.# Both the version and the builder number may be overrIDden in Flutter# build by specifying --build-name and --build-number,respectively.# Read more about versioning at semver.org.version: 1.0.0+1environment:  sdk: ">=2.0.0-dev.68.0 <3.0.0"dependencIEs:  Flutter:    sdk: Flutter  # The following adds the Cupertino Icons Font to your application.  # Use with the CupertinoIcons class for iOS style icons.  cupertino_icons: ^0.1.2  firebase_auth: 0.8.0  firebase_database: 1.1.0+1dev_dependencIEs:  Flutter_test:    sdk: Flutter# For information on the generic Dart part of this file,see the# following page: https://www.dartlang.org/tools/pub/pubspec# The following section is specific to Flutter.Flutter:  # The following line ensures that the Material Icons Font is  # included with your application,so that you can use the icons in  # the material Icons class.  uses-material-design: true  # To add assets to your application,add an assets section,like this:  # assets:  #  - images/a_dot_burr.jpeg  #  - images/a_dot_ham.jpeg  # An image asset can refer to one or more resolution-specific "variants",see  # https://Flutter.io/assets-and-images/#resolution-aware.  # For details regarding adding assets from package dependencIEs,see  # https://Flutter.io/assets-and-images/#from-packages  # To add custom Fonts to your application,add a Fonts section here,# in this "Flutter" section. Each entry in this List should have a  # "family" key with the Font family name,and a "Fonts" key with a  # List giving the asset and other descriptors for the Font. For  # example:  # Fonts:  #   - family: Schyler  #     Fonts:  #       - asset: Fonts/Schyler-Regular.ttf  #       - asset: Fonts/Schyler-Italic.ttf  #         style: italic  #   - family: Trajan Pro  #     Fonts:  #       - asset: Fonts/TrajanPro.ttf  #       - asset: Fonts/TrajanPro_Bold.ttf  #         weight: 700  #  # For details regarding Fonts from package dependencIEs,# see https://Flutter.io/custom-Fonts/#from-packagesassets:  - assets/Flutter-icon.png
最佳答案您需要迁移到AndroIDX或降级到与AndroIDX之前版本兼容的插件版本.

关注与迁移相关的问题的https://github.com/flutter/flutter/issues/27106(另请参见https://github.com/flutter/flutter/issues/27146、https://github.com/flutter/flutter/issues/27128,以获取与您的问题相同的错误输出)

也可以看看

Breaking change. Migrate from the deprecated original AndroID Support library to AndroIDX. This shouldn’t result in any functional changes,but it requires any AndroID apps using this plugin to 07003 if they’re using the original support library.

总结

以上是内存溢出为你收集整理的的Flutter和Firebase:任务’:firebase_auth:compileDebugJavaWithJavac’的执行失败 全部内容,希望文章能够帮你解决的Flutter和Firebase:任务’:firebase_auth:compileDebugJavaWithJavac’的执行失败 所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1144998.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-31
下一篇 2022-05-31

发表评论

登录后才能评论

评论列表(0条)

保存