我正在研究新的 android 材料,它看起來不錯,但為了正確使用顏色選項,我需要使用 com.google.android.material:material:1.1.0(最新的是 alpha08)顯然有一個依賴性問題,因為當我在 android studio 中構建時它說一切正常但是當我運行時它丟失了 android material com.android.builder.dexing.DexArchiveBuilderException在運行時(像這樣)。這是我的 app.build.gradledependencies { implementation 'androidx.core:core:1.0.2' implementation 'androidx.media:media:1.0.1' implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.appcompat:appcompat:1.0.2' implementation 'io.reactivex.rxjava2:rxandroid:2.1.1' implementation 'io.reactivex.rxjava2:rxjava:2.2.10' implementation 'com.google.android.material:material:1.0.0' // fails if I switch to implementation 'com.google.android.material:material:1.1.0-alpha08' api 'com.google.guava:guava:28.0-android' implementation files('libs/acra-4.5.0.jar') implementation files('libs/commons-collections-3.2.1.jar') implementation 'com.google.firebase:firebase-core:17.0.1' implementation 'com.google.firebase:firebase-messaging:19.0.1' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.exifinterface:exifinterface:1.0.0'}據我所知,我們的一切都處于最佳狀態,所以你認為問題是什么?
1 回答

慕工程0101907
TA貢獻1887條經驗 獲得超5個贊
我發現這是原因,將其添加到build.gradle [Module.app]文件中
android {
[.YOUR.OTHER.STUFF.HERE.]
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
添加回答
舉報
0/150
提交
取消