【发布时间】:2018-03-23 15:59:18
【问题描述】:
今天,我打开了 Android Studio,然后我得到了这个错误。昨天,没有这样的问题!
错误:任务 ':app:processDebugResources' 执行失败。
错误:多个库的包名称为“com.google.android.gms.license”
com.google.android.gms:play-services-xxx 库是
11.8.0
Onesignal 库是
'com.onesignal:OneSignal:[3.6.2, 3.99.99]'
然后我将它们更改为最新版本。
现在应用/Gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "xxx.xxx.xxx"
minSdkVersion 15
targetSdkVersion 24
versionCode 10
versionName 'x.x.x'
manifestPlaceholders = [onesignal_app_id: "xxxxx-xx-xxx",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "XXX"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
repositories {
maven { url 'https://maven.google.com' }
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.mcxiaoke.volley:library:1.0.18'
compile 'com.github.chrisbanes.photoview:library:1.2.3'
compile 'com.facebook.android:facebook-android-sdk:4.0.1'
compile 'com.google.android.gms:play-services-ads:12.0.0'
//compile 'com.google.android.gms:play-services-ads:11.2.2'
compile 'com.pkmmte.view:circularimageview:1.1'
compile 'com.melnykov:floatingactionbutton:1.3.0'
compile 'com.squareup.okhttp:okhttp:2.5.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
//compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:appcompat-v7:27.1.0'
compile 'com.android.support:cardview-v7:27.1.0'
compile 'com.android.support:recyclerview-v7:27.1.0'
compile 'com.android.support:design:27.1.0'
compile 'com.balysv:material-ripple:1.0.2'
compile "com.google.firebase:firebase-messaging:12.0.0"
compile 'com.github.hotchemi:android-rate:1.0.1'
compile 'com.onesignal:OneSignal:[3.7.1, 3.99.99]'
compile 'com.google.android.gms:play-services-analytics:12.0.0'
}
apply plugin: 'com.google.gms.google-services'
项目/Gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.1.1'
// classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
但我仍然遇到上述相同的错误。我怎么解决这个问题?为什么昨天没有问题,今天又出现了这个问题?
【问题讨论】:
-
没有人回答。知道的请回答。谢谢..
-
您在两个地方添加了相同的依赖项,正如错误所说。在顶级 Project/Gradle 和“模块”应用程序中 ...
-
看不懂你的回答,我该怎么办?
-
尝试从 Project/Gradle 中移除
services依赖,并在 Project/Gradle 中添加google()repositories。
标签: java android android-studio android-gradle-plugin