Failed to install extracted secondary dex & java.io.IOException: unable to open DEX file

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Failed to install extracted secondary dex & java.io.IOException: unable to open DEX file



Hardware information


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



Build.gradle


android
compileSdkVersion 27
defaultConfig
minSdkVersion 15
targetSdkVersion 25

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




here my minSdkVersion > 14 , so it support multidex



important log


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)



Extracte apk secondary dexes succeeded, but installSecondaryDexes failed



I try to


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




but failed too, Any help greatly appreciated.





api "com.android.support:multidex:1.0.3"
– haiyang wu
Aug 3 at 3:23





android compileSdkVersion 27 buildToolsVersion "27.0.3" defaultConfig minSdkVersion 15 // > 14 so It's not for this reason targetSdkVersion 25 // Enabling multidex support. multiDexEnabled true dependencies compile 'com.android.support:multidex:1.0.3'
– haiyang wu
Aug 3 at 8:07




1 Answer
1



Modify your "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'





My build.gradle : android compileSdkVersion 27 buildToolsVersion "27.0.3" defaultConfig minSdkVersion 15 // > 14 so It's not for this reason targetSdkVersion 25 // Enabling multidex support. multiDexEnabled true dependencies compile 'com.android.support:multidex:1.0.3' Have you got any ideas?@Heera Verma
– haiyang wu
Aug 3 at 6:41







By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

make 2 or more post in bootsrap

Store custom data using WC_Cart add_to_cart() method in Woocommerce 3

Firebase Auth - with Email and Password - Check user already registered