现在我已将所有依赖项更新到最新版本,然后我遇到了这个问题。
com.google.android.gms库:play-services-basement正在[[15.0.1,15.0.1]]的各个其他图书馆请求,但已解析为16.0.1。禁用插件并使用./gradlew:app:dependencies检查依赖关系树。
classpath 'com.google.gms:google-services:4.0.2'
和
implementation 'com.google.firebase:firebase-messaging:17.3.3'
implementation "com.google.android.gms:play-services-maps:16.0.1"
implementation "com.google.android.gms:play-services-location:16.0.1"
请帮我解决这个问题...在此先感谢...
发生这种冲突是因为使用了较旧的库,解决方案是尽可能使用最新的库。在我的情况下我使用firebase版本16.0.0,当前最新版本是16.0.4(07-02-2019)
我正在使用它
implementation 'com.google.firebase:firebase-core:16.0.0'
而不是这个
implementation 'com.google.firebase:firebase-core:16.0.4'
Android(项目级build.gradle)
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.0.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "26.1.0"
}
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Android(App - level build.gradle)
apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 28
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.chatflutterapp.fullterchat"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
compile 'com.google.firebase:firebase-core:16.0.4'
}
apply plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
我有同样的问题,在我的情况下,按照这些步骤运行:
1)评论所有firebase依赖项
2)评论所有类别的firebase用法
3)清理和重建项目
4)取消注释所有注释行