我得到這個錯誤:重複的條目:安卓/支持/註解/ ColorRes.class
Error:Execution failed for task ':mobile:packageAllDebugClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: android/support/annotation/ColorRes.class
我在做什麼?
1- multiDexEnabled
2-補充一點:配置{所有* .exclude組: 'com.android.support',模塊: '支持-V4'}和沒有工作(另一個重複條目錯誤)
3-逐個刪除依賴關係。不工作或收到其他錯誤
4 - 排除依賴逐個並不起作用
可能是什麼問題呢?
的build.gradle
apply plugin: 'com.android.application'
dependencies
{
compile 'com.android.support:support-v4:22.2.1'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:cardview-v7:21.0.3'
compile 'com.android.support:recyclerview-v7:21.0.3'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.google.maps.android:android-maps-utils:0.4'
compile 'com.afollestad:material-dialogs:[email protected]'
compile 'com.bignerdranch.android:recyclerview-multiselect:0.1'
compile 'com.j256.ormlite:ormlite-android:4.48'
compile 'com.melnykov:floatingactionbutton:1.2.0'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
compile 'se.emilsjolander:StickyScrollViewItems:1.1.0'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile files('libs/appodeal-1.13.10.jar')
compile files('libs/applovin-6.1.4.jar')
compile files('libs/inmobi-5.0.1.jar')
compile files('libs/android-support-v4-22.2.1.jar')
compile files('libs/my-target-4.1.2.jar')
compile files('libs/yandex-metrica-android-2.00.jar')
}
android
{
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig
{
minSdkVersion 15
targetSdkVersion 22
versionCode VERSION_MAJOR*10000000 + VERSION_MINOR*100000 + VERSION_PATCH*1000 + VERSION_BUILD
versionName "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}"
// Enabling multidex support.
multiDexEnabled true
configurations {
all*.exclude group: 'com.android.support', module: 'support-v4'
}
}
不能肯定地說,但我的猜測是它的相關的支持庫使用多個不同的版本號, – Brucelet
@Brucelet謝謝,改變所有的第EM到22,但不起作用 –