当我在Android Studio 3.3.1中更新依赖项时,出现以下错误: Android Studio版本:3.3.1 Gradle版本:5.4
Caused by: com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\Users\Mohamad\.gradle\caches\modules-2\files-2.1\javaee\javaee-api\5\e3cc17b10ab552219edbe33915e62937e387d0ef\javaee-api-5.jar
这是我的build.gradle文件:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services'
configurations {
implementation.exclude group: "org.apache.httpcomponents", module: "httpclient"
}
android {
compileSdkVersion 28
buildToolsVersion "29.0.0-rc2"
defaultConfig {
applicationId "xxx.xxx.xxx"
minSdkVersion 17
targetSdkVersion 28
versionCode 10
versionName "3.1.1"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
defaultConfig {
resConfigs "en"
}
packagingOptions {
exclude 'META-INF/LICENSE'
}
dexOptions {
jumboMode = true
javaMaxHeapSize "4g"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "androidx.appcompat:appcompat:1.0.2"
implementation "com.google.android.material:material:1.1.0-alpha05"
implementation "androidx.percentlayout:percentlayout:1.0.0"
implementation "androidx.cardview:cardview:1.0.0"
implementation 'androidx.multidex:multidex:2.0.1'
implementation "androidx.recyclerview:recyclerview:1.1.0-alpha05"
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.squareup.okhttp3:okhttp:3.14.1'
implementation 'jp.wasabeef:picasso-transformations:2.2.1'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.google.http-client:google-http-client-android:1.20.0'
implementation 'com.google.api-client:google-api-client-android:1.20.0'
implementation 'com.google.api-client:google-api-client-gson:1.20.0'
implementation 'com.google.android.gms:play-services-analytics:16.0.8'
implementation 'com.r0adkll:slidableactivity:2.0.5'
implementation 'com.mikepenz:fontawesome-typeface:5.3.1.1'
implementation 'com.mikepenz:material-design-iconic-typeface:2.2.0.4'
implementation 'com.mikepenz:google-material-typeface:3.0.1.2.original'
implementation 'com.mikepenz:actionitembadge:3.3.2@aar'
implementation 'com.mikepenz:iconics-core:3.2.5@aar'
implementation 'com.mikepenz:iconics-views:3.2.5@aar'
implementation 'com.snappydb:snappydb-lib:0.5.2'
implementation 'com.esotericsoftware.kryo:kryo:2.24.0'
implementation 'io.jsonwebtoken:jjwt:0.7.0'
implementation 'za.co.riggaroo:materialhelptutorial:1.2.0'
implementation 'net.hockeyapp.android:HockeySDK:5.1.1'
implementation 'com.ibm.icu:icu4j:64.2'
implementation 'org.piwik.sdk:piwik-sdk:3.0.2'
implementation 'org.piwik.java.tracking:piwik-java-tracker:1.2'
implementation project(':persianmaterialdatetimepicker')
implementation project(':fullscreendialog')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
我清理,重建,使缓存无效并重新启动,但无济于事...
我看到了这样的问题,但是那些问题并没有帮助我。 我能做什么?有人帮忙吗????
答案 0 :(得分:0)
这种形式的问题与依赖项中的重复类有关,要解决此问题,只需将这段代码放在build.gradle中:
configurations {
all*.exclude group: 'javaee', module: 'javaee-api'
}