gpt4 book ai didi

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

转载 作者:可可西里 更新时间:2023-11-01 19:01:21 26 4
gpt4 key购买 nike

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

Gradle 文件:

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's Maven Repository 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

提前致谢。

最佳答案

您需要更新 google-service 插件才能使用:

classpath 'com.google.gms:google-services:3.3.0'

为了能够避免这些错误,还要升级到android studio 3.1

If you're not using Android Studio 3.1 to develop your app, you will need to upgrade in order to get the correct version checking behavior within the IDE.

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

Announcing new SDK versioning

Compilation failed to complete:Program type already present: com.google.android.gms.internal.measurement.zzabn

关于java - 所有 gms/firebase 库必须使用完全相同的版本。找到版本 15.1.0、15.0.2、15.0.1、15.0.0。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50197427/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com