【问题标题】:Firebase dependency issueFirebase 依赖问题
【发布时间】:2020-05-19 00:27:59
【问题描述】:

大家好,我是 Flutter 的新手,在学习了一些课程之后,我已经能够开发出很酷的应用程序和设计。但为了进一步学习,我被引导将 FireStore 与我的 android 应用程序链接起来。 当我这样做时,一旦我在 pubspect.yaml 文件中声明依赖项,就会收到此错误消息:

> Could not find method implementation() for arguments [project ':firebase_core'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

* 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


And some more errors of the same
I tried creating an application from scratch again and before designing any layout to do the Firestore integration first then once fine, move on to the code and design

THIS IS THE ERROR GENERATED ON A EMPTY PROJECT I CREATED, Please HELP ME SOLVING IT

 [Fatal Error] error_prone_annotations-2.2.0.pom:2:1: Content is not allowed in prolog.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':cloud_firestore'.
> Could not resolve all artifacts for configuration ':cloud_firestore:classpath'.
> Could not resolve com.google.errorprone:error_prone_annotations:2.2.0.
     Required by:
         project :cloud_firestore > com.android.tools.build:gradle:3.3.0 > com.android.tools.build:bundletool:0.6.0
> Could not resolve com.google.errorprone:error_prone_annotations:2.2.0.
> Could not parse POM https://jcenter.bintray.com/com/google/errorprone/error_prone_annotations/2.2.0/error_prone_annotations-2.2.0.pom
> Content is not allowed in prolog.
> Could not resolve com.google.errorprone:error_prone_annotations:2.2.0.
     Required by:
         project :cloud_firestore > com.android.tools.build:gradle:3.3.0 > com.android.tools.analytics-library:shared:26.3.0 > com.google.guava:guava:26.0-jre
> Could not resolve com.google.errorprone:error_prone_annotations:2.2.0.
> Could not parse POM https://jcenter.bintray.com/com/google/errorprone/error_prone_annotations/2.2.0/error_prone_annotations-2.2.0.pom
> Content is not allowed in prolog.
> Failed to notify project evaluation listener.
> Could not get unknown property 'android' for project ':cloud_firestore' of type org.gradle.api.Project.
> Could not find method implementation() for arguments [project ':firebase_core'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

* 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 23s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done                        24.2s
Gradle task assembleDebug failed with exit code 1

如何解决? 这些是我添加到 .yaml 文件中的依赖项 依赖:

  carousel_pro: ^1.0.0

  firebase_auth: ^0.15.4
  cloud_firestore: ^0.13.0+1
  google_sign_in: ^4.1.1
  shared_preferences: ^0.5.6+1
  fluttertoast: ^3.1.3

【问题讨论】:

  • 你确定你添加了正确间距的包吗?
  • 是的! package Get 命令运行良好。当我“颤动运行”它时,错误就来了。有什么想法吗?

标签: android gradle flutter google-cloud-firestore flutter-dependencies


【解决方案1】:

您面临的错误似乎与您的 Gradle 版本有关。 通过错误Could not find method implementation() for arguments [project ':firebase_core'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler搜索,我可以找到一些似乎与您有关的案例。

您可以在此处访问这些案例:

考虑到这一点,您能否看看它们并确认使用最新的 Gradle 版本是否可以解决您的问题?

告诉我进展如何!

【讨论】:

  • 这很有帮助!第一个链接。我更改了 gradle 版本并从实现更改为编译非常感谢!但是我从另一台计算机上获得的项目不需要这些更改!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2019-03-25
  • 1970-01-01
  • 2021-05-01
  • 2018-06-06
  • 2020-01-04
  • 1970-01-01
  • 2012-05-23
相关资源
最近更新 更多