程序问答   发布时间:2022-06-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了错误完成:Gradle任务assembleDebug失败,退出代码为1大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决错误完成:Gradle任务assembleDebug失败,退出代码为1?

开发过程中遇到错误完成:Gradle任务assembleDebug失败,退出代码为1的问题如何解决?下面主要结合日常开发的经验,给出你关于错误完成:Gradle任务assembleDebug失败,退出代码为1的解决方法建议,希望对你解决错误完成:Gradle任务assembleDebug失败,退出代码为1有所启发或帮助;

主要问题似乎是您使用的cloud_firestore插件版本0.9.0 已迁移到AndroIDX,但您的项目尚未迁移。因此,看来这两个选项是使用该cloud_firestore插件的先前版本或将您的项目迁移到AndroIDX。

要将您的项目迁移到AndroIDX,请按照我在上面的评论中提到的链接(Firebase auth插件崩溃IOS和android#27422)以及我的初始响应的AndroID部分(发布在用户名app-o-matix下 )下,按照步骤1进行操作。 -3。其余步骤和后续帖子可能有助于避免其他问题。

这是链接页面上的步骤1-3(我使用IntelliJ IDea CE,并在创建Flutter项目时选择了Swift和Kotlin):

1)在AndroID Studio中打开Flutter项目的AndroID部分。确保您使用的是AndroID Studio 3.3。(我完全关闭了IntelliJ IDea,打开了AndroID Studio,单击“ _文件”

2)在文件 添加以下两行[my_project]/androID/gradle.propertIEs

androID.useandroidX=true
androID.enableJetifIEr=true

3)在AndroID Studio主菜单中,选择“ 重构” >“迁移到AndroIDx …”, 。依次执行“ 文件” >“全部保存”,然后退出AndroID Studio。

作为迁移后的一项额外措施,在IntelliJ IDea中,我运行“ 工具” >“ Flutter”>“ Flutter Clean”,“ _文件”

解决方法

Launching lib\main.dart on HTC One M9PLUS 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\cloud_firestore-0.9.0\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:9: error: cannot find symbol import androidx.annotation.NonNull;
                          ^   symbol:   class NonNull   location: package androidx.annotation C:\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.9.0\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:10: error: cannot find symbol import androidx.annotation.Nullable;
                          ^   symbol:   class Nullable   location: package androidx.annotation C:\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.9.0\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:253: error: cannot find symbol
          public void onFailure(@NonNull Exception e) {
                                 ^   symbol: class NonNull C:\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.9.0\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:274: error: cannot find symbol
                    public Void apply(@NonNull Transaction transaction)
                                       ^   symbol: class NonNull C:\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.9.0\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:272: error: cannot find symbol
                    @Nullable
                     ^   symbol: class Nullable C:\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.9.0\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:503: error: cannot find symbol
                    public void onFailure(@NonNull Exception e) {
                                           ^   symbol: class NonNull C:\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.9.0\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:558: error: cannot find symbol
                    public void onFailure(@NonNull Exception e) {
                                           ^   symbol: class NonNull 7 errors

FAILURE: Build failed with an exception.

* What went wrong: Execution failed for task ':cloud_firestore: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.org

BUILD FAILED in 26s Finished with error: Gradle task assembleDebug failed with exit code 1

我只是试图将Firebase添加到项目中

大佬总结

以上是大佬教程为你收集整理的错误完成:Gradle任务assembleDebug失败,退出代码为1全部内容,希望文章能够帮你解决错误完成:Gradle任务assembleDebug失败,退出代码为1所遇到的程序开发问题。

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

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: