首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何修复google play服务错误

如何修复google play服务错误
EN

Stack Overflow用户
提问于 2018-05-03 22:37:37
回答 9查看 94.1K关注 0票数 44

今天,在更新了根文件夹中的播放服务后,我遇到了以下问题。我对如何解决这个问题感到困惑。

有人能帮我解决这个问题吗?

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

错误

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

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'

}
EN

回答 9

Stack Overflow用户

回答已采纳

发布于 2018-05-03 22:55:26

您的其中一个依赖项是具有不同版本的com.google.android.gms

更新

与过去不同的是,

Firebase依赖项具有独立的版本。如果你有版本冲突,你可以更新你的com.google.gms:google-services。并开始定义独立版本。

更新com.google.gms:google-services

转到顶级(项目) build.gradle并将com.google.gms:google-services更新为version 4.1.0 or newer if available

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

将Firebase依赖项更新为

Firebase依赖版本可以是单独的。因此,请查看。

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

原始解决方案(有用)

解决方法:

conflicted dependency.

  • Update
  1. .
  2. Change your com.google.android.gms com.google.android.gms as conflicted version中的依赖关系。

问题

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

1.命令解决方案

对于安卓系统的,请使用这行

 gradle app:dependencies

如果你有一个包装器:

./gradlew app:dependencies

其中app是您的项目模块。

此外,如果您想要检查某些东西是否是compiletestCompileandroidTestCompile的依赖关系,以及是什么在拉入它:

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

2使用这些插件

Gradle View是一个Android Studio插件,您可以安装并显示依赖层次结构。Methods Count是另一个插件,它还显示依赖树。

票数 40
EN

Stack Overflow用户

发布于 2018-08-25 14:17:38

试试看,这对我很有效。

将其添加到您的build.gradle文件末尾

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

使用google play服务。版本4.3.0

googleServices.disableVersionCheck = true
票数 18
EN

Stack Overflow用户

发布于 2018-05-04 13:12:49

Firebase Android SDKs now have independent version numbers,允许更频繁、更灵活的更新。

将google play gradle插件版本更新到最新版本,目前为3.3.0。

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

并将库更新到latest version

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

此外,作为reported,请至少使用版本15.0.2:

您需要将后一个依赖项的版本更新为15.0.2。这解决了Google Services Gradle插件3.3.0版本报告的问题:库com.google.android.gms:play-services-measurement-base正被位于[15.0.0,15.0.0,15.0.2,15.0.2]的各种其他库请求,但解析为15.0.2...

票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50157690

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档