Firebase身份验证导致Gradle失败

问题描述 投票:0回答:1

我正在尝试将Firebase Auth添加到我的flutter项目中,但是当我这样做时,出现以下错误:

完成错误:Gradle任务assembleDebug失败,退出代码为1

我正在做的是将以下内容添加到我的pubspec.yaml文件中:

firebase_auth:^ 0.14.0 + 9

我已经在Github页面上发布了此内容,却一无所获,所以我猜测它是一个独特的错误。对故障的反馈不多,因此很难调试。我已经尝试了几天了。

感谢您的任何帮助!

[ +231 ms] [ +362 ms] Building bundle
[        ] [   +1 ms] Writing asset files to C:\Users\jonathan.king\App Dev\oto_app_0\build\app\intermediates\flutter\debug\android-x86/flutter_assets
[ +200 ms] [ +201 ms] Wrote C:\Users\jonathan.king\App Dev\oto_app_0\build\app\intermediates\flutter\debug\android-x86/flutter_assets
[        ] [   +6 ms] "flutter bundle" took 6,855ms.
[ +398 ms] > Task :app:packLibsflutterBuildDebug UP-TO-DATE
[ +199 ms] > Task :app:checkDebugClasspath UP-TO-DATE
[        ] > Task :app:preBuild UP-TO-DATE
[        ] > Task :firebase_auth:preBuild UP-TO-DATE
[        ] > Task :firebase_auth:preDebugBuild UP-TO-DATE
[        ] > Task :firebase_auth:checkDebugManifest UP-TO-DATE
[        ] > Task :firebase_auth:processDebugManifest UP-TO-DATE
[        ] > Task :firebase_core:preBuild UP-TO-DATE
[        ] > Task :firebase_core:preDebugBuild UP-TO-DATE
[   +1 ms] > Task :firebase_core:checkDebugManifest UP-TO-DATE
[        ] > Task :firebase_core:processDebugManifest UP-TO-DATE
[        ] > Task :flutter_ble:preBuild UP-TO-DATE
[        ] > Task :flutter_ble:preDebugBuild UP-TO-DATE
[        ] > Task :flutter_ble:checkDebugManifest UP-TO-DATE
[        ] > Task :flutter_ble:processDebugManifest UP-TO-DATE
[        ] > Task :app:preDebugBuild FAILED
[        ] 10 actionable tasks: 2 executed, 8 up-to-date
[ +743 ms] Running Gradle task 'assembleDebug'... (completed in 13.2s)
[   +2 ms] "flutter run" took 19,860ms.
Gradle task assembleDebug failed with exit code 1

#0      throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
#1      _buildGradleProjectV2 (package:flutter_tools/src/android/gradle.dart:751:5)
<asynchronous suspension>
#2      buildGradleProject (package:flutter_tools/src/android/gradle.dart:494:14)
<asynchronous suspension>
#3      buildApk (package:flutter_tools/src/android/apk.dart:34:9)
<asynchronous suspension>
#4      AndroidDevice.startApp (package:flutter_tools/src/android/android_device.dart:486:13)
<asynchronous suspension>
#5      FlutterDevice.runHot (package:flutter_tools/src/resident_runner.dart:378:54)
<asynchronous suspension>
#6      HotRunner.run (package:flutter_tools/src/run_hot.dart:254:39)
<asynchronous suspension>
#7      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:472:37)
<asynchronous suspension>
#8      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:490:18)
#9      _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#10     _rootRunUnary (dart:async/zone.dart:1132:38)
#11     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#12     _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#13     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#14     Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#15     Future._completeWithValue (dart:async/future_impl.dart:522:5)
#16     _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:30:15)
#17     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:288:13)
#18     RunCommand.usageValues (package:flutter_tools/src/commands/run.dart)
#19     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#20     _rootRunUnary (dart:async/zone.dart:1132:38)
#21     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#22     _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#23     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#24     Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#25     Future._completeWithValue (dart:async/future_impl.dart:522:5)
#26     _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:30:15)
#27     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:288:13)
#28     AndroidDevice.isLocalEmulator (package:flutter_tools/src/android/android_device.dart)
#29     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#30     _rootRunUnary (dart:async/zone.dart:1132:38)
#31     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#32     _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#33     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#34     Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#35     Future._completeWithValue (dart:async/future_impl.dart:522:5)
#36     Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:552:7)
#37     _rootRun (dart:async/zone.dart:1124:13)
#38     _CustomZone.run (dart:async/zone.dart:1021:19)
#39     _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#40     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#41     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#42     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#43     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:116:13)
#44     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:173:5)
firebase gradle flutter
1个回答
0
投票
尝试使用旧的firebase_auth插件

0
投票
我通过重新启动Android Studio中的flutter项目解决了这一问题。我确保不使用Kotlin,然后再次遵循firebase教程(https://firebase.google.com/docs/flutter/setup)。我必须将以下代码添加到gradle.properties中:

android.useAndroidX = trueandroid.enableJetifier = true

似乎现在可以正常工作

© www.soinside.com 2019 - 2024. All rights reserved.