0

I have written an app, and have uploaded it to internal testing on Google Play. Following Google's recommendation, this time I have gone with an Android Application Bundle instead of an APK.

When I download it from the Play store, it crashes immediately with java.lang.ClassNotFoundException

If I run the app through Android Studio as a Default APK, it works fine. If I run the app through Android Studio as "APK from app bundle", it also works fine.

My app has three modules. "app" is the main bit. I have a 3d engine module named bulletspeed. The missing class is from the bulletspeed module. I don't know if the third module is missing classes yet, as the program hasn't advanced that far before crashing.

Is there some sort of module setting that I am missing?

Thanks for any help!

Jamie
  • 1,888
  • 1
  • 18
  • 21

3 Answers3

2

As it turns out, my issue was was with proguard. The classes were there all along, just renamed to c.c.b.a.wtf.etc

  • During the build process, I serialize some 3D scenes into a Java ObjectOutputStream.
  • In my program, I deserialize the scenes from OOS resources back into Objects
  • Deserialization could not find the classes by name as the names were obfuscated

Following this guide, I was able to configure proguard rules so that I could deserialize normally: https://medium.com/androiddevelopers/practical-proguard-rules-examples-5640a3907dc9

Jamie
  • 1,888
  • 1
  • 18
  • 21
1

It doesn't solve the issue but helps you with testing:

Download the bundletool from Google https://developer.android.com/studio/command-line/bundletool and create apk from app bundle locally to test, so you won't need to create a bunch of internal app testings and wait...

  1. create the app bundle (.aab) and locate the folder
  2. java -jar "bundletool-all-x.x.x.jar" build-apks --bundle="yourpathto.aab" --output="folderoutput.zip" --mode="universal"
  3. unzip the created zip package
  4. install the general apk into your test device/emulator
zeg
  • 432
  • 2
  • 9
1

You can try uncompressing native libs by default in your Android Manifest.

Setting android:extractNativeLibs=false to reduce app size

Sahil Goel
  • 11
  • 2