【发布时间】:2016-08-05 07:51:20
【问题描述】:
Android 上应用程序的 gradle,该应用程序在我的设备 Android 5.1 的调试模式下完美运行
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "cl.datacomputer.alejandrob.gogps"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
// Enabling multidex support.
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['android-5.0.1_r1.jar'], exclude: 'android-support-v4.jar', dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:multidex:1.0.1'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.google.android.gms:play-services:8.4.0'
compile('com.android.support:appcompat-v7:23.1.0') {
exclude module: 'support-v4'
}
compile 'com.android.support:design:23.4.0'
}
这是错误,我不明白错误在哪里,对不起,如果我的英语不好,但我试着理解,我需要你的帮助,如果你需要更多详细信息,我会在这里阅读所有关于这对我没有任何作用。
java.util.zip.zipexception: duplicate entry:android/support/annotation/colorres.class
【问题讨论】:
-
我建议您只使用播放服务中所需的特定模块,而不是使用整个非常庞大的库
-
Tim Castelijns 我怎么做这个?,这是我第一次使用 Android Studio 和 Gradle。
-
您有一些文档:developers.google.com/android/guides/setup 通过使用
compile 'com.google.android.gms:play-services:8.4.0',您的应用程序将包含所有服务。而且可能您不需要其中的大多数...例如,如果您只需要 Google+,您应该使用com.google.android.gms:play-services-plus:8.4.0。您可以在上面的链接中的表 1 中获得每项服务的详细信息。 -
我用你的推荐解决了这个问题,但是 lib android.jar 编译 fileTree(include: ['android-5.0.1_r1.jar'], exclude: 'android-support-v4.jar' , dir: 'libs') 我直接反编译并删除错误的.class,现在制作和APK并正确构建。
标签: android google-maps-api-2 android-support-design android-appcompat