我一直收到此错误,并尝试了所有步骤来修复在网上发现的问题。该错误表明gms / firebase库的版本错误,但应用程序中没有firebase依赖项。
错误:
“所有gms / firebase库必须使用完全相同的版本规范(混合版本可能导致运行时崩溃。找到的版本16.0.1、16.0.0。示例包括com.google.android.gms:play-services-base:16.0.1
和com.google.android.gms:play-services-maps:16.0.0
”
依存关系com.google.android.gms:play-services-maps:16.0.0
不在我的依存关系中,但与play-services-maps相比,它仍然说它是错误的版本。
我尝试将play-services-maps更改为16.0.1,但是该版本不存在。我也尝试将implementation 'com.google.android.gms:play-services-base:16.0.0'
添加到文件中,但是它给出了相同的错误。
我的Build.gradle(应用程序)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.nameomitted"
minSdkVersion 24
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:26.1.0'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.android.support:support-annotations:27.1.1'
implementation 'com.android.support:support-v4:26.1.0'
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'
}
我的Build.gradle(项目)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
预先感谢