如何修复谷歌播放服务错误

2024-03-08

今天更新根文件夹中的播放服务后,我面临以下问题。我很困惑如何解决这个问题。

谁能帮我解决这个问题吗?

这个错误非常令人恼火。我不知道冲突在哪里。顺便说一句,为什么它显示冲突,而没有版本相互关联。

Error :

库 com.google.android.gms:play-services-measurement-base 是 被[[15.0.0,15.0.0]上的其他各个库请求, [15.0.2,15.0.2]],但解析为 15.0.2。禁用插件并检查 使用 ./gradlew :app:dependencies 构建依赖关系树。

构建.gradle脚本 :

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'



android {
configurations.all {
    resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
    applicationId "community.infinity"
    minSdkVersion 16
    targetSdkVersion 27
    versionCode 1
    versionName "1.0"
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    multiDexEnabled true
}
aaptOptions {
    cruncherEnabled = false
}
dexOptions {
    preDexLibraries false
    javaMaxHeapSize "4g"
}
buildTypes {
    release {
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard- android.txt'), 'proguard-rules.pro'
    }
    debug {
        ext.enableCrashlytics = false
    }
}

compileOptions {
    targetCompatibility 1.8
    sourceCompatibility 1.8
}

}

 dependencies {

implementation 'com.google.firebase:firebase-core:15.0.0'
implementation 'com.google.firebase:firebase-messaging:15.0.0'
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support'
    exclude module: 'support-annotations'
    exclude module: 'support-v4'
    exclude module: 'support-v13'
    exclude module: 'recyclerview-v7'
    exclude group: 'com.android.support', module: 'appcompat-v7'
})
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.adamstyrc.cookiecutter:cookie-cutter:1.0.2'
implementation 'com.allattentionhere:fabulousfilter:0.0.5'
implementation 'com.github.florent37:diagonallayout:1.0.6'
implementation 'com.flaviofaria:kenburnsview:1.0.7'
implementation 'com.vstechlab.easyfonts:easyfonts:1.0.0'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.github.pwittchen:swipe:0.1.0'
implementation 'com.thesurix.gesturerecycler:gesture-recycler:1.4.0'
implementation 'com.github.iammert:MaterialIntroView:1.6.0'
implementation 'com.github.oxoooo:touch-image-view:1.0.1'
implementation 'com.github.deano2390:MaterialShowcaseView:1.2.0'
implementation 'com.squareup.okhttp:okhttp-urlconnection:1.6.0'
implementation('io.socket:socket.io-client:0.8.3') {
    // excluding org.json which is provided by Android
    exclude group: 'org.json', module: 'json'
}
implementation 'com.google.gms:google-services:3.3.0'
implementation 'com.iceteck.silicompressorr:silicompressor:2.1'
implementation 'com.fenchtose.nocropper:nocropper:0.2.0'
implementation 'me.relex:circleindicator:1.2.2@aar'
implementation('com.google.guava:guava:23.4-android') {
    exclude group: 'com.android.support'
    exclude module: 'support-annotations'
    exclude module: 'support-v4'
    exclude module: 'support-v13'
    exclude module: 'recyclerview-v7'
    exclude group: 'com.android.support', module: 'appcompat-v7'
}
implementation 'com.github.amlcurran.showcaseview:library:5.4.3'
implementation 'com.orhanobut:hawk:2.0.1'
implementation 'com.zsoltsafrany:needle:1.0.0'
implementation 'com.github.madrapps:pikolo:1.1.6'
implementation 'jp.wasabeef:richeditor-android:1.2.2'
implementation 'com.android.support:palette-v7:27.1.1'
testImplementation 'junit:junit:4.12'
implementation('com.github.bumptech.glide:glide:4.4.0') {
    transitive = true
}
implementation ("com.github.bumptech.glide:recyclerview-integration:4.4.0")   {
    // Excludes the support library because it's already included by Glide.
    transitive = false
}
annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'
implementation 'com.android.support:multidex:1.0.3'
implementation "me.leolin:ShortcutBadger:1.1.21@aar"
implementation 'com.hbb20:ccp:2.1.2'

}

您的依赖之一是拥有不同版本的com.google.android.gms.

Update

与过去不同,Firebase 依赖项具有独立版本。如果 您有版本冲突,那么您可以更新您的com.google.gms:google-services。并开始定义独立 版本。

Update com.google.gms:google-services

转到顶部(项目)级别 build.gradle 并更新com.google.gms:google-services到版本4.1.0 或更新版本(如果有) https://mvnrepository.com/artifact/com.google.gms/google-services?repo=bt-android-tools.

buildscript {
    ...
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.0'
        classpath 'com.google.gms:google-services:4.1.0' //< update this 
    }
}

将 Firebase 依赖项更新为最新版本 https://firebase.google.com/support/release-notes/android

Firebase 依赖项版本可以是单独的。所以检查一下最新版本 https://firebase.google.com/support/release-notes/android.

com.google.firebase:firebase-core:16.0.3    //Analytics
com.google.firebase:firebase-database:16.0.2    //Realtime Database

原始解决方案(有用)

解决方法:

  1. Exclude https://stackoverflow.com/a/36103326/6891563 com.google.android.gms来自冲突的依赖。
  2. 更新该依赖项如果可供使用的话 https://firebase.google.com/support/release-notes/android.
  3. 改变你的com.google.android.gms版本为冲突版本。

Problem

如何查看正在使用哪个依赖项com.google.android.gms?

1.通过命令解决

对于 Android,请使用此行

 gradle app:dependencies

或者如果你有一个 gradle 包装器:

./gradlew app:dependencies

where app是你的项目模块。

此外,如果您想检查某些内容是否存在compile vs. testCompile vs androidTestCompile依赖性以及拉动它的因素:

./gradlew :app:dependencyInsight --configuration compile --dependency <name>
./gradlew :app:dependencyInsight --configuration testCompile --dependency <name>
./gradlew :app:dependencyInsight --configuration androidTestCompile --dependency <name>

2 使用这些插件

摇篮视图 https://github.com/rholder/gradle-view是一个 Android Studio 插件,您可以安装并显示依赖关系层次结构。方法计数 http://www.methodscount.com/plugins是另一个插件,它还显示依赖关系树。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何修复谷歌播放服务错误 的相关文章

随机推荐