所有gms / firebase库必须使用完全相同的版本。找到版本15.1.0、15.0.2、15.0.1、15.0.0。

【字号: 日期:2024-02-23浏览:49作者:雯心
如何解决所有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中获得正确的版本检查行为。

更多信息和要遵循的步骤:

宣布新的SDK版本

解决方法

尝试在我的项目中实施Firebase。

摇篮文件:

apply plugin: ’com.android.application’android {compileSdkVersion 27defaultConfig { applicationId 'com.ghaleh.myapplication' minSdkVersion 16 targetSdkVersion 27 versionCode 1 versionName '1.0' testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' }buildTypes { release {minifyEnabled falseproguardFiles 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

提前致谢。

相关文章: