如何解决所有gms / firebase库必须使用完全相同的版本找到版本15.1.0、15.0.2、15.0.1、15.0.0
您需要更新google-service
插件才能使用:
classpath 'com.google.gms:google-services:3.3.0'
为了避免这些错误,请同时升级到android studio 3.1
如果您未使用Android Studio 3.1开发应用程序,则需要进行升级才能在IDE中获得正确的版本检查行为。
更多信息和要遵循的步骤:
解决方法
尝试在我的项目中实施Firebase。
摇篮文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.ghaleh.myapplication"
minSdkVersion 16
targetSdkVersion 27
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:27.1.1'
implementation 'com.android.support:support-media-compat:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
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'
implementation 'com.google.firebase:firebase-messaging:15.0.2'
}
apply plugin: 'com.google.gms.google-services'
我收到此错误:
All gms/firebase libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 15.1.0,15.0.2,15.0.1,15.0.0. Examples include com.google.firebase:firebase-iid:15.1.0 and com.google.android.gms:play-services-measurement-base:15.0.2
根据Google的Maven存储库,最新版本firebase-
messaging
为15.0.2,我收到了错误消息,firebase-iid:15.1.0
因此我无法将升级firebase-
messaging
到更高版本或实现firebase-iid:15.1.0
来匹配这些版本。
我已经尝试过其他的解决方案,在这里推荐:1,2,3,但其中非是有用的。
我也尝试过此方法(但是,这似乎不是一个合适的解决方案):
implementation ('com.google.firebase:firebase-messaging:15.0.2') {
exclude group: "com.google.android.gms"
}
我得到这个错误:
Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForBazaarDebug'.
java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
提前致谢。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。