我有一个firebase flutter应用程序,一切正常,但是当我添加firebase_messaging:^ 5.1.4。该应用程序提供以下信息:
失败:构建失败,并出现异常。
* What went wrong:
Could not determine the dependencies of task ':app:preDebugBuild'.
> In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[18.0.
0]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.
Dependency failing: com.google.firebase:firebase-messaging:18.0.0 -> com.google.firebase:firebase-iid@[18.0.0], but fire
base-iid version was 19.0.0.
The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
ifact with the issue.
-- Project 'app' depends on project 'firebase_messaging' which depends onto com.google.firebase:firebase-messaging@18.0.
0
-- Project 'app' depends onto com.google.firebase:firebase-core@17.0.0
-- Project 'app' depends on project 'cloud_functions' which depends onto com.google.firebase:firebase-functions@17.0.0
-- Project 'app' depends on project 'firebase_core' which depends onto com.google.firebase:firebase-core@16.0.9
For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep
endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://
github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b
uild.gradle file.
这些是我的其他包裹
firebase_auth:^ 0.11.1 + 12 firebase_storage:^ 3.0.4 cloud_firestore:^ 0.12.7 + 1 cloud_functions:^ 0.4.1 + 1
(他们都工作)
我的构建包中有此文件:classpath'com.google.gms:google-services:4.2.0'
实现'com.google.firebase:firebase-core:17.0.0'
有没有办法解决这个问题?
非常感谢您!
答案 0 :(得分:0)
我目前正在尝试:
在应用程序级别build.gradle中,我有这个:
应用插件:“ com.google.gms.google-services”
我要添加以下内容: com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
(在应用插件后:“ com.google.gms.google-services”)
答案 1 :(得分:0)
在pub spec.yaml中包含Firebase Core依赖项,并且未指定firebase依赖项的版本可以解决大多数问题。
答案 2 :(得分:0)
运行这两行
rm Podfile.lock
pod install --repo-update
这些将完成工作。我花了两天时间来解决它