Firebase 依赖问题
Firebase dependency issue
大家好,我是 Flutter 的新手,经过一些课程后已经能够开发出很酷的应用程序和设计。但是为了进一步学习,我被引导到 link 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
您遇到的错误似乎与您的 Gradle 版本有关。
通过错误 Could not find method implementation() for arguments [project ':firebase_core'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler
搜索,我可以找到一些与您的相关的案例。
您可以在此处访问这些案例:
考虑到这一点,能否请您看一下它们并确认使用最新的 Gradle 版本是否可以解决您的问题?
让我知道进展如何!
大家好,我是 Flutter 的新手,经过一些课程后已经能够开发出很酷的应用程序和设计。但是为了进一步学习,我被引导到 link 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
您遇到的错误似乎与您的 Gradle 版本有关。
通过错误 Could not find method implementation() for arguments [project ':firebase_core'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler
搜索,我可以找到一些与您的相关的案例。
您可以在此处访问这些案例:
考虑到这一点,能否请您看一下它们并确认使用最新的 Gradle 版本是否可以解决您的问题?
让我知道进展如何!