【发布时间】:2018-10-11 19:35:21
【问题描述】:
我已将我的应用更新为compileSdkVersion 27,我还将gradle plugin 更新为3.0.1',并将所有play-services 库更新为version 15.0.0
现在,当我构建应用程序时,它会给我以下错误消息。
无法解决:play-services-basement
我正在使用force 'com.google.android.gms:play-services-basement:15.0.0',我无法理解为什么它会给我这个错误信息。
这些是我的 gradle 设置。
compileSdkVersion 27
buildToolsVersion "27.0.1"
defaultConfig {
applicationId ''
minSdkVersion 21
targetSdkVersion 27
versionCode 285
multiDexEnabled true
resConfigs "en"
}
resolutionStrategy {
force 'com.squareup.okhttp:okhttp:2.4.0'
force 'com.squareup.okhttp:okhttp-urlconnection:2.4.0'
force 'com.android.support:support-v4:24.1.1'
force 'com.android.support:cardview-v7:24.1.1'
force 'com.android.support:appcompat-v7:24.1.1'
force 'com.android.support:design:24.1.1'
force 'com.google.android.gms:play-services-ads:15.0.0'
force 'com.google.android.gms:play-services-location:15.0.0'
force 'com.google.android.gms:play-services-auth-base:15.0.1'
force 'com.google.android.gms:play-services-base:15.0.0'
force 'com.google.android.gms:play-services-maps:15.0.0'
force 'com.google.android.gms:play-services-identity:15.0.0'
force 'com.google.android.gms:play-services-wallet:15.0.0'
force 'com.google.android.gms:play-services-tasks:15.0.0'
force 'com.google.android.gms:play-services-basement:15.0.0'
force 'com.google.firebase:firebase-common:15.0.0'
force 'com.google.android.gms:play-services-base:15.0.0'
}
dependencies {
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.google.android.gms:play-services-maps:15.0.0'
implementation 'com.google.android.gms:play-services-analytics:15.0.0'
implementation 'com.google.android.gms:play-services-location:15.0.0'
implementation 'com.google.firebase:firebase-appindexing:15.0.0'
implementation 'com.google.android.gms:play-services-auth:15.0.0'
implementation 'com.google.android.gms:play-services-auth-base:15.0.0'
implementation 'com.google.android.gms:play-services-panorama:15.0.0'
implementation 'com.google.android.gms:play-services-ads:15.0.0'
implementation('com.google.firebase:firebase-messaging:15.0.0') {
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'support-annotations'
}
implementation 'com.google.firebase:firebase-core:15.0.0'
implementation 'org.jsoup:jsoup:1.8.3'
}
Gradle-wrapper-properties
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.2.0'
【问题讨论】:
-
您已经拥有
play-services-base。play-services-basement是不必要的:stackoverflow.com/questions/36461656/…。此外,15.0.0 已经过时,大多数 Play 服务都在 16.0.x。
标签: android performance firebase android-gradle-plugin