Invalid dex file indices, expecting file 'classes٢.dex' but found 'classes2.dex'.
如何解决这个大问题?
该错误也出现在我的第二个项目上
build.gradle(:app)
文件:`
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
}
android {
compileSdkVersion 31
buildToolsVersion "30.0.3"
//configurations.all {
// resolutionStrategy {
// force 'com.android.support:support-v4:27.1.0'
// }}
defaultConfig {
applicationId "********"
minSdkVersion 21
targetSdkVersion 31
versionCode 4
versionName "1.3"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {
viewBinding true
}
}
dependencies {
api 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
implementation 'com.github.bumptech.glide:glide:3.6.1'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.5.0-beta01'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.android.gms:play-services-auth:19.2.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0'
implementation 'androidx.constraintlayout:constraintlayout-compose:1.0.1'
implementation 'androidx.navigation:navigation-fragment:2.3.5'
implementation 'androidx.navigation:navigation-ui:2.3.5'
implementation 'com.google.android.play:core:1.10.2'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'com.github.ibrahimsn98:SmoothBottomBar:1.7.6'
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'de.hdodenhof:circleimageview:3.1.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
def lottieVersion = "3.4.0"
implementation "com.airbnb.android:lottie:$lottieVersion"
implementation 'com.scwang.wave:MultiWaveHeader:1.0.0-alpha-1'
implementation 'com.github.traex.rippleeffect:library:1.3'
implementation 'com.google.code.gson:gson:2.8.7'
implementation 'com.google.firebase:firebase-auth:19.3.2'
implementation 'com.google.firebase:firebase-core:17.5.0'
implementation 'com.google.firebase:firebase-database:20.1.0'
implementation 'com.google.firebase:firebase-storage:19.1.1'
implementation platform('com.google.firebase:firebase-bom:28.2.1')
implementation 'com.google.firebase:firebase-analytics:17.5.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.facebook.fresco:fresco:2.5.0'
implementation 'com.caverock:androidsvg-aar:1.4'
implementation 'com.github.mergehez:ArgPlayer:v2.1'
implementation 'com.eightbitlab:blurview:1.6.6'
implementation 'com.github.recruit-lifestyle:PlayPauseButton:1.0'
implementation 'com.github.claucookie.miniequalizer:library:1.0.0'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
implementation 'com.github.alxrm:youtube-play-icon:0.9'
implementation 'com.facebook.shimmer:shimmer:0.5.0'
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
implementation 'com.cloudinary:cloudinary-android:1.30.0'
implementation 'com.github.bumptech.glide:glide:4.12.0'
implementation('com.google.android.libraries.places:places:2.7.0') { exclude module: 'glide' }
implementation 'com.google.guava:guava:27.0.1-android'
implementation 'com.startapp:inapp-sdk:4.8.9'
implementation 'com.android.volley:volley:1.2.1'
implementation 'com.google.android.gms:play-services-ads:21.3.0'
implementation 'com.google.firebase:firebase-ads:21.3.0'
implementation project(':nativetemplates')
implementation 'com.google.firebase:firebase-iid:21.1.0@aar'
implementation 'com.kenilt.loopingviewpager:loopingviewpager:0.2.0'
implementation 'com.google.firebase:firebase-messaging:23.1.0'
implementation 'com.tbuonomo.andrui:viewpagerdotsindicator:3.0.3'
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
implementation 'com.android.support:multidex:1.0.3'
}
apply plugin: 'com.google.gms.google-services'
`
??????????????????????????????????????????????????????????????????????????? multiDexEnabled = false
?????????????????????????????????????????????????????????????????????????????????????????????????????????