首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >提取`.aab`文件时出错:无效的dex文件索引,期望文件'classes٢.dex‘但找到'classes2.dex’

提取`.aab`文件时出错:无效的dex文件索引,期望文件'classes٢.dex‘但找到'classes2.dex’
EN

Stack Overflow用户
提问于 2021-08-06 18:48:39
回答 1查看 470关注 0票数 3

当我提取aab文件时会出现此错误:

代码语言:javascript
复制
Invalid dex file indices, expecting file 'classes٢.dex' but found 'classes2.dex'.

我的梯度应用程序:

代码语言:javascript
复制
apply plugin: 'com.android.application'

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"

defaultConfig {
    applicationId "com.rewardstom.win"
    minSdkVersion 19
    multiDexEnabled true
    targetSdkVersion 30
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

lintOptions {

    checkReleaseBuilds false
}

dexOptions {
    javaMaxHeapSize "4g"
    preDexLibraries = false
}


}

dependencies {

    implementation 'com.android.support:multidex:1.0.3'
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation fileTree(dir: 'libs', include: ['*.aar', '*.jar'])
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

    implementation 'androidx.appcompat:appcompat:1.3.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
    implementation 'com.google.android.material:material:1.4.0'

    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'androidx.palette:palette:1.0.0'
    implementation 'com.android.volley:volley:1.2.0'
    implementation 'com.facebook.android:facebook-login:7.1.0'

    implementation platform('com.google.firebase:firebase-bom:28.2.0')
    implementation 'com.google.firebase:firebase-auth'
    implementation 'com.google.firebase:firebase-messaging'
    implementation 'com.google.android.gms:play-services-auth:19.2.0'
    implementation 'com.google.firebase:firebase-dynamic-links'
    implementation "androidx.browser:browser:1.3.0"

    //Ads
    implementation 'com.google.android.gms:play-services-ads:20.2.0'
    implementation 'com.google.android.gms:play-services-ads-identifier:17.0.1'
    implementation 'com.google.android.gms:play-services-basement:17.6.0'

    api 'com.tapjoy:tapjoy-android-sdk:12.8.0@aar'
    implementation 'com.fyber:offerwall-sdk:9.2.2'
    implementation 'com.applovin:applovin-sdk:10.2.1'
    implementation 'com.adcolony:sdk:4.5.0'
    implementation 'com.chartboost:chartboost-sdk:8.2.0'
    implementation 'com.ironsource.sdk:mediationsdk:7.1.7'
    implementation 'com.github.vungle:vungle-android-sdk:6.7.1'
    implementation 'com.facebook.android:audience-network-sdk:6.5.1'

    //noinspection GradleDependency
    implementation 'commons-io:commons-io:2.4'
}
apply plugin: 'com.google.gms.google-services'
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-11-24 21:35:46

一个可能有效的临时解决方案是设置

代码语言:javascript
复制
release {
    minifyEnabled false
    .......
}

这将减少应用程序的大小,这可能导致它只使用一个dex文件

如果此操作不起作用,则需要将Windows显示语言更改为使用的语言。阿拉伯数字 (包括您的管理语言设置)。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68686299

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档