gpt4 book ai didi

android - 无法安装提取的辅助 dex & java.io.IOException : unable to open DEX file

转载 作者:行者123 更新时间:2023-11-29 01:00:22 26 4
gpt4 key购买 nike

硬件信息

    phone: Huawei Mate 7(MT7-TL10)
OS: Android 4.4.2
CPU: Kirin925

构建.gradle

android {
compileSdkVersion 27
defaultConfig {
minSdkVersion 15
targetSdkVersion 25
}
dependencies {
compile 'com.android.support:multidex:1.0.3'
}
}

这里我的 minSdkVersion > 14 ,所以它支持 multidex

重要日志

    I/MultiDex( 4514): VM with version 1.6.0 does not have multidex support
I/MultiDex( 4514): Installing application
I/MultiDex( 4514): MultiDexExtractor(/data/app/pkg_name-1.apk, /data/data/pkg_name/code_cache/secondary-dexes)
I/MultiDex( 4514): Blocking on lock /data/data/pkg_name/code_cache/secondary-dexes/MultiDex.lock
I/MultiDex( 4514): /data/data/pkg_name/code_cache/secondary-dexes/MultiDex.lock locked
I/MultiDex( 4514): MultiDexExtractor.load(/data/app/pkg_name-1.apk, false, )
I/MultiDex( 4514): Detected that extraction must be performed.

I/MultiDex( 4514): Extraction is needed for file /data/data/pkg_name/code_cache/secondary-dexes/pkg_name-1.apk.classes2.zip
I/MultiDex( 4514): Extracting /data/data/pkg_name/code_cache/secondary-dexes/tmp-pkg_name-1.apk.classes1353338101.zip
08-01

I/MultiDex( 4514): Renaming to /data/data/pkg_name/code_cache/secondary-dexes/pkg_name-1.apk.classes2.zip
I/MultiDex( 4514): Extraction succeeded '/data/data//pkg_name/code_cache/secondary-dexes//pkg_name-1.apk.classes2.zip': length 3303095 - crc: 3802116964
I/MultiDex( 4514): Extraction is needed for file /data/data//pkg_name/code_cache/secondary-dexes//pkg_name-1.apk.classes3.zip

I/MultiDex( 4514): Renaming to /data/data/pkg_name/code_cache/secondary-dexes/pkg_name-1.apk.classes3.zip
I/MultiDex( 4514): Extraction succeeded '/data/data/pkg_name/code_cache/secondary-dexes/pkg_name-1.apk.classes3.zip': length 1904964 - crc: 3374652227
I/MultiDex( 4514): load found 2 secondary dex files

W/MultiDex( 4514): Failed to install extracted secondary dex files, retrying with forced extraction
W/MultiDex( 4514): java.io.IOException: unable to open DEX file
W/MultiDex( 4514): at dalvik.system.DexFile.openDexFile(Native Method)
W/MultiDex( 4514): at dalvik.system.DexFile.<init>(DexFile.java:109)
W/MultiDex( 4514): at dalvik.system.DexFile.loadDex(DexFile.java:149)
W/MultiDex( 4514): at android.support.multidex.b$a.a(MultiDex.java:700)
W/MultiDex( 4514): at android.support.multidex.b$a.a(MultiDex.java:660)
W/MultiDex( 4514): at android.support.multidex.b.a(MultiDex.java:349)
W/MultiDex( 4514): at android.support.multidex.b.a(MultiDex.java:263)
W/MultiDex( 4514): at android.support.multidex.b.a(MultiDex.java:112)
W/MultiDex( 4514): at pkg_name.baselib.base.BaseApplication.attachBaseContext(BaseApplication.java:59)

提取apk二级dexes成功,但安装SecondaryDexes失败

我努力

@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
try {
MultiDex.install(this);
} catch(Exception e) {
e.printStackTrace();
}
}

但也失败了,非常感谢任何帮助。

最佳答案

修改你的“build.gradle”

android {
compileSdkVersion 22
buildToolsVersion "23.0.0"

defaultConfig {
minSdkVersion 14 //lower than 14 doesn't support multidex
targetSdkVersion 22

// Enabling multidex support.
multiDexEnabled true
}
}

dependencies {
compile 'com.android.support:multidex:1.0.3'
}

关于android - 无法安装提取的辅助 dex & java.io.IOException : unable to open DEX file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51664728/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com