如何解决谷歌游戏服务错误如何解决谷歌游戏服务错误(How to fix google play se

2019-05-11 21:55发布

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

任何人都可以请帮我解决这一问题?

此错误是刺激了不少。 我不知道哪来的冲突。 通过它为什么显示虽然没有版本是相互关联的冲突的方式。

错误

图书馆com.google.android.gms:播放服务测量基被要求通过各种其他图书馆在[15.0.0,15.0.0],[15.0.2,15.0.2],但解析15.0.2。 禁用插件并使用./gradlew检查你的依赖树:应用:依赖关系。

的build.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'

}

Answer 1:

一个你所依赖的是不同版本的com.google.android.gms

更新

火力地堡依赖性具有独立的版本不像过去。 如果您有版本冲突,那么你可以更新您的com.google.gms:google-services 。 并开始定义的独立版本。

更新com.google.gms:google-services

转至顶部(项目)级的build.gradle和更新com.google.gms:google-services到版本4.1.0 或者如果有更新 。

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

更新火力地堡依赖于最新版本

火力地堡依赖版本可以是单独的。 因此,检查最新版本

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

一部开拓创新的解决方案(有用的)

方法来解决:

  1. 排除 com.google.android.gms从冲突依赖。
  2. 更新依赖关系(如果可用)
  3. 更改com.google.android.gms版本为冲突的版本。

问题

怎么看这依赖使用com.google.android.gms

1.溶液通过命令

对于Android,使用下面这行

 gradle app:dependencies

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

./gradlew app:dependencies

其中, app是你的项目模块。

此外,如果你想看一看是compiletestCompile VS androidTestCompile依赖以及什么是拉动它:

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

2使用这些插件

摇篮视图是一个Android Studio插件,您可以安装并显示依赖性层次结构。 方法计数是另外一个插件,它也显示了依赖关系树。



Answer 2:

火力地堡Android推出的SDK 现在有独立的版本号 ,从而更频繁,灵活的更新。

更新谷歌玩gradle这个插件版本到最新版本,目前3.3.0。

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

并更新库到最新版本 。

Firebase Core   com.google.firebase:firebase-core:15.0.2
Ads             com.google.firebase:firebase-ads:15.0.0
Analytics       com.google.firebase:firebase-analytics:15.0.2
App Indexing    com.google.firebase:firebase-appindexing:15.0.0
Authentication  com.google.firebase:firebase-auth:15.1.0
Cloud Firestore com.google.firebase:firebase-firestore:16.0.0
Cloud Functions com.google.firebase:firebase-functions:15.0.0
Cloud Messaging com.google.firebase:firebase-messaging:15.0.2
Cloud Storage   com.google.firebase:firebase-storage:15.0.2
Crash Reporting com.google.firebase:firebase-crash:15.0.2
Crashlytics     com.crashlytics.sdk.android:crashlytics:2.9.1
Invites         com.google.firebase:firebase-invites:15.0.2
Performance Monitoring  com.google.firebase:firebase-perf:15.1.0
Realtime Database   com.google.firebase:firebase-database:15.0.0
Remote Config   com.google.firebase:firebase-config:15.0.2

另外,作为报告的使用至少15.0.2版:

您将需要更新后者依赖的版本15.0.2。 这解决了上述问题,其中的谷歌服务摇篮插件报告3.3.0版本:库com.google.android.gms:被请求通过各种其他图书馆发挥服务测量基在[15.0.0,15.0。 0],[15.0.2,15.0.2],但解析为15.0.2 ...



Answer 3:

尝试这是为我工作。

在文件的您的build.gradle末尾添加这

com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true


Answer 4:

火力地堡组件现在可以有独立的版本(见最新版本说明: https://firebase.google.com/support/release-notes/android )

什么是可能发生的事情是你的其他依赖的一个拉动的com.google.firebase的多个版本:*依赖超出了你的显式依赖于

implementation 'com.google.firebase:firebase-core:15.0.0'
implementation 'com.google.firebase:firebase-messaging:15.0.0'

您可以通过移动火力点的消息的依赖到15.0.2解决这个特定的问题。



Answer 5:

对我来说,我需要更新com.google.android.gms:play-services-base到版本15.0.1 ,而不是15.0.0

implementation "com.google.android.gms:play-services-base:15.0.1"



Answer 6:

需要与其他火力部件一起使用核心库组件:

implementation 'com.google.firebase:firebase-core:16.0.0'


Answer 7:

我就遇到了这个问题,我发现我在本节的解决方案https://firebase.google.com/support/release-notes/android#20180508

这表明,并非所有的火力依赖对当前构建相同的版本号。 所以,你需要单独更新每一个。 我最终的配置是这样的:

implementation "com.google.firebase:firebase-core:15.0.2" implementation "com.google.firebase:firebase-ml-vision:15.0.0" implementation "com.google.firebase:firebase-appindexing:15.0.0" implementation "com.google.android.gms:play-services-ads:15.0.0" implementation "com.google.android.gms:play-services-maps:15.0.0" implementation "com.google.android.gms:play-services-places:15.0.0" implementation "com.google.android.gms:play-services-location:15.0.0" implementation "com.google.firebase:firebase-auth:15.0.0" implementation "com.google.firebase:firebase-database:15.0.0" implementation "com.firebaseui:firebase-ui-database:1.0.1" implementation "com.google.firebase:firebase-storage:15.0.2" implementation "com.google.firebase:firebase-messaging:15.0.2"

希望你能看到的差异,新的更新为谷歌服务插件3.3.0的结果



文章来源: How to fix google play service error