所有gms/firebase库必须使用完全相同的Android版本规范 [英] All gms/firebase libraries must use the exact same version specification Android
问题描述
试图更新时
'com.google.firebase:firebase-crash:10.2.0'
至'com.google.firebase:firebase-crash:11.8.0'
我收到此错误
While tring to update
'com.google.firebase:firebase-crash:10.2.0'
to 'com.google.firebase:firebase-crash:11.8.0'
I am getting this error
所有gms/firebase库必须使用完全相同的版本 规范(混合版本可能导致运行时崩溃).成立 版本11.8.0、10.2.0.例子包括 com.google.android.gms:play-services-basement:11.8.0和 com.google.android.gms:play-services-base:10.2.0
All gms/firebase libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 11.8.0, 10.2.0. Examples include com.google.android.gms:play-services-basement:11.8.0 and com.google.android.gms:play-services-base:10.2.0
如何解决此错误?
app build.gradle
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.firebase.firebase-crash'
repositories {
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/ksoap2-android-releases/"
}
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
dexOptions {
jumboMode = true
}
defaultConfig {
applicationId "com.myapp.myapp"
minSdkVersion 16
multiDexEnabled true
targetSdkVersion 27
versionCode 6
versionName '1.1'
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}
productFlavors {
}
// configurations {
// all*.exclude group: 'org.apache.commons'
// }
}
repositories {
mavenCentral()
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion "$rootProject.ext.supportLibraryVersion"
}
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':platform')
compile project(':ahbottomnavigation')
compile project(':mylibrary')
compile('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') {
transitive = true
}
compile('com.google.android.gms:play-services-cast-framework:10.2.0') {
exclude group: 'com.android.support', module: 'mediarouter-v7'
}
compile project(':bottom-bar')
compile project(':journey')
compile "com.android.support:appcompat-v7:$rootProject.ext.supportLibraryVersion"
compile "com.android.support:recyclerview-v7:$rootProject.ext.supportLibraryVersion"
compile 'com.google.firebase:firebase-crash:11.8.0'
compile 'com.github.rahatarmanahmed:circularprogressview:2.5.0'
compile 'com.flurry.android:analytics:6.9.0'
compile "com.android.support:mediarouter-v7:$rootProject.ext.supportLibraryVersion"
compile 'com.googlecode.android-query:android-query:0.25.9'
compile 'com.github.hotchemi:android-rate:1.0.1'
compile "com.android.support:cardview-v7:$rootProject.ext.supportLibraryVersion"
compile "com.android.support:support-v4:$rootProject.ext.supportLibraryVersion"
compile 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.facebook.android:facebook-login:4.31.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
$ rootProject.ext.supportLibraryVersion =='27.1.0'
推荐答案
我不知道子项目的 build.gradle 外观如何,它们应该与您的版本相同应用程序build.gradle ,如果您在子项目中使用了任何com.google.
库.
I have no idea how your build.gradle for sub-projects look like, they should have same version as your app build.gradle, if you used any of com.google.
libs inside the sub-projects.
但是您的compile('com.google.android.gms:play-services-cast-framework:10.2.0')
应该具有相同的版本11.8.0
However your compile('com.google.android.gms:play-services-cast-framework:10.2.0')
should have the same version 11.8.0
这篇关于所有gms/firebase库必须使用完全相同的Android版本规范的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!