简体   繁体   English

评估项目“:firebase_auth”时出现问题

[英]A problem occurred evaluating project ':firebase_auth'

this error doesn't occur when project is already running state.当项目已经在运行 state 时,不会发生此错误。 but next day i tried to run the same project then this error apears.但第二天我试图运行同一个项目然后出现这个错误。

FAILURE: Build failed with an exception. FAILURE:构建失败并出现异常。

  • Where: Build file 'D:\src\flutter.pub-cache\hosted\pub.dartlang.org\firebase_auth-3.2.0\android\build.gradle' line: 58其中:构建文件 'D:\src\flutter.pub-cache\hosted\pub.dartlang.org\firebase_auth-3.2.0\android\build.gradle' 行:58

  • What went wrong: A problem occurred evaluating project ':firebase_auth'.出了什么问题:评估项目“:firebase_auth”时出现问题。

Could not load compiled classes for script 'D:\src\flutter.pub-cache\hosted\pub.dartlang.org\firebase_auth-3.2.0\android\user-agent.gradle' from cache.无法从缓存加载脚本“D:\src\flutter.pub-cache\hosted\pub.dartlang.org\firebase_auth-3.2.0\android\user-agent.gradle”的编译类。

  • Try: Run with --stacktrace option to get the stack trace.尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output.使用 --info 或 --debug 选项运行以获得更多日志 output。 Run with --scan to get full insights.运行 --scan 以获得完整的见解。

  • Get more help at https://help.gradle.orghttps://help.gradle.org获得更多帮助

BUILD FAILED in 17s 17 秒内构建失败

Exception: Gradle task assembleDebug failed with exit code 1 Exited (sigterm)异常:Gradle 任务 assembleDebug 失败,退出代码 1 退出(sigterm)

this are my pubspec.yml dependencies这是我的 pubspec.yml 依赖项

version: 1.0.0+1

environment:
  sdk: ">=2.12.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: ^1.0.2
  firebase_core: "^1.10.0"
  firebase_auth: ^3.2.0

This looks like an android configuration problem.这看起来像是android 配置问题。

The solution is to add the dependencies to your android project.解决方案是将依赖项添加到您的 android 项目中。

The first step is to follow the instructions on Firebase Auth's pub.dev page第一步是按照 Firebase Auth 的 pub.dev 页面上的说明进行操作

You can do this by adding the following lines to your android/build.gradle file:您可以通过将以下行添加到您的android/build.gradle文件中来做到这一点:

dependencies {
    // Example existing classpath
    classpath 'com.android.tools.build:gradle:3.2.1'
   // Add the google services classpath
   classpath 'com.google.gms:google-services:4.3.0'
 }

and adding the following line to the bottom of your android/app/build.gradle file并将以下行添加到您的android/app/build.gradle文件的底部

  apply plugin: 'com.google.gms.google-services'

The next thing to do is add the Firebase Auth plugin to your android implementations接下来要做的是将 Firebase Auth 插件添加到您的android 实现

To do this you should follow the instructions => https://firebase.google.com/docs/android/setup#available-libraries为此,您应该按照说明操作 => https://firebase.google.com/docs/android/setup#available-libraries

Cheers: :-)干杯::-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM