简体   繁体   中英

Issue with executing an Android application over 2GB of APK file?

I am trying to execute an APK file size over 2GB and it's giving me an error:

java.lang.ClassNotFoundException: Didn't find class: MyApplication... on path: DexPathList[..]

It successfully installs the APK on the device but when I try to execute the application, I get the above error.

I have tested installing and executing an APK with size of 1.99GB but it worked fine. Then also I've tested with APK size 2.01GB but it failed with above error.

The device I'm using to test is Galaxy S8 with Android Nougat.

This APK file isn't intended to be uploaded on Google Play Store which means it isn't going to use the expansion files; all of the contents will be included inside of the APK file itself.

I have tried many methods to fix the error by researching them but I had no luck. Things I've tried:

  1. Cleaned and rebuilt.
  2. Enabled & disabled multidex in build.gradle.
  3. Give full path of the MainActivity & MyApplication class in AndroidManifest.
  4. Tested with many other gradle versions.
  5. Disabled proguard.
  6. etc.

Basically I think I tried almost all of the suggestions online about ClassNotFoundException with dex.

I thought since it works with anything under 2GB, I can only guess that there is a size limit of an APK that a device can run?

Or is there any other solution that I can try?

Check if you have included arm64-v8a

arm64-v8a

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM