gpt4 book ai didi

java - 包名称为 'com.google.android.gms' 的多个库

转载 作者:行者123 更新时间:2023-11-29 19:42:55 26 4
gpt4 key购买 nike

我找到了很多关于这个问题的帖子,但没有一个对我有用。这是我的 Gradle:

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.0"

defaultConfig {
applicationId "*********"
minSdkVersion 16
targetSdkVersion 23
versionCode 5
versionName "1.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:cardview-v7:21.0.+'
compile 'com.android.support:recyclerview-v7:21.0.+'
compile files('libs/gradle-wrapper.jar')
compile 'com.facebook.fresco:fresco:0.9.0+'
compile 'com.facebook.android:audience-network-sdk:4.+'
compile 'com.google.android.gms:play-services:7.8.0'

}

我不知道问题出在哪里。

最佳答案

你可以想象成一棵树:

gradle -q dependencies yourProject:dependencies --configuration compile

或者在 Windows 上,使用 gradlew

gradlew -q dependencies yourProject:dependencies --configuration compile

示例输出:

compile - Classpath for compiling the main sources.
+--- org.androidannotations:androidannotations-api:3.2
+--- com.android.support:support-annotations:22.1.1
+--- com.squareup:otto:1.3.6
+--- in.srain.cube:grid-view-with-header-footer:1.0.10
+--- com.nostra13.universalimageloader:universal-image-loader:1.9.3
+--- com.github.chrisbanes.photoview:library:1.2.3
+--- org.simpleframework:simple-xml:2.7.1
+--- com.google.android.gms:play-services-base:6.5.+ -> 6.5.87
+--- project :yourProject
| +--- com.loopj.android:android-async-http:1.4.6
| +--- org.apache.httpcomponents:httpmime:4.2.5
| | \--- org.apache.httpcomponents:httpcore:4.2.4
| \--- com.google.code.gson:gson:2.3.1
+--- project :facebook
| \--- com.android.support:appcompat-v7:22.1.1
| \--- com.android.support:support-v4:22.1.1
| \--- com.android.support:support-annotations:22.1.1 -> 22.2.0

为避免重复,在每个项目build.gradle中添加exclude

compile('com.github.chrisbanes.photoview:library:1.2.3') {
exclude group: 'com.android.support'
}
compile('org.simpleframework:simple-xml:2.7.1') {
exclude module: 'stax'
exclude module: 'stax-api'
exclude module: 'xpp3'
}
compile('com.google.android.gms:play-services-base:6.5.+')
{
exclude module: 'support-v4'
}

这是从以下样本中抽取的:gradle - library duplicates in dependencies

关于java - 包名称为 'com.google.android.gms' 的多个库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38310216/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com