Cannot deploy to Android App Bundle

Whenever I upload my app bundle to the Google Play Developer Console, their test results give me this(I also tested it on my own device, it crashed)

FATAL EXCEPTION: ControllerMessenger
Process: com.indigoa.game.crushed, PID: 26018
java.lang.ExceptionInInitializerError
	at com.jme3.system.AppSettings.<clinit>(AppSettings.java:150)
	at com.jme3.app.AndroidHarness.onCreate(AndroidHarness.java:223)
	at com.indigoa.android.crushed.MainActivity.onCreate(MainActivity.java:91)
	at android.app.Activity.performCreate(Activity.java:7174)
	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220)
	at androidx.test.runner.MonitoringInstrumentation.callActivityOnCreate(MonitoringInstrumentation.java:172)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2908)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3030)
	at android.app.ActivityThread.-wrap11(Unknown Source:0)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
	at android.os.Handler.dispatchMessage(Handler.java:105)
	at androidx.test.espresso.base.Interrogator.a(Interrogator.java:19)
	at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:164)
	at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:156)
	at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:34)
	at androidx.test.espresso.action.MotionEvents.a(MotionEvents.java:76)
	at androidx.test.espresso.action.MotionEvents.a(MotionEvents.java:51)
	at androidx.test.espresso.action.Tap.c(Tap.java:8)
	at androidx.test.espresso.action.Tap.a(Tap.java:18)
	at androidx.test.espresso.action.Tap$1.b(Tap.java:3)
	at androidx.test.espresso.action.GeneralClickAction.perform(GeneralClickAction.java:22)
	at androidx.test.espresso.ViewInteraction$SingleExecutionViewAction.perform(ViewInteraction.java:9)
	at androidx.test.espresso.ViewInteraction.a(ViewInteraction.java:79)
	at androidx.test.espresso.ViewInteraction.a(ViewInteraction.java:96)
	at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:3)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at android.os.Handler.handleCallback(Handler.java:789)
	at android.os.Handler.dispatchMessage(Handler.java:98)
	at android.os.Looper.loop(Looper.java:164)
	at android.app.ActivityThread.main(ActivityThread.java:6938)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.Reader.read(char[])' on a null object reference
	at java.util.Properties$LineReader.readLine(Properties.java:432)
	at java.util.Properties.load0(Properties.java:348)
	at java.util.Properties.load(Properties.java:336)
	at com.jme3.system.JmeVersion.<clinit>(JmeVersion.java:51)
	... 33 more

…would been nice to know the JME version.

Fortunately, the other class hasn’t moved:

So in 90 seconds, I found your issue by a few clicks.

Somehow people are managing to get JME libraries without the versions.properties file in it. This happened to someone else trying to run their app outside the SDK. Not sure how it happens. Could be part of the android build in this case… I don’t know what process you went through to get here.

And now I’ve already provided more info in my answer than you did in your question.

Where can I get version.properties? And how can I get it into my bundle?
I couldn’t find it in the repo: https://github.com/jMonkeyEngine/jmonkeyengine/search?p=1&q=version.properties&unscoped_q=version.properties
Note that version.properties is ONLY missing when building an android app bundle. DEBUG APKS BUILD FINE. My guess is it’s related to the bundle build process. Any idea what part of that causes the problem?

It’s created as part of the build process and bundled into the .jar then.

C:\Development\github\jmonkeyengine.git\dist\lib>jar -tvf jme3-core.jar
     0 Sat Jan 26 19:59:34 EST 2019 META-INF/
    96 Sat Oct 27 04:00:54 EDT 2018 META-INF/MANIFEST.MF
     0 Sat Jan 26 19:59:26 EST 2019 checkers/
     0 Sat Jan 26 19:59:26 EST 2019 checkers/quals/
  1078 Sat Jan 26 19:59:26 EST 2019 checkers/quals/DefaultLocation.class
...
   183 Sat Jan 26 19:59:34 EST 2019 com/jme3/asset/Desktop.cfg
  1503 Sat Jan 26 19:59:34 EST 2019 com/jme3/asset/General.cfg
   292 Sat Jan 26 19:59:34 EST 2019 com/jme3/system/version.properties
     0 Sat Jan 26 19:59:34 EST 2019 Common/
...

Note:

   292 Sat Jan 26 19:59:34 EST 2019 com/jme3/system/version.properties

The file was in my library. Do you know hot to make sure it’s included in the app bundle build process?

I don’t know anything about building for android. Maybe someone else does.

This is also caused by sometthing in JME: A (really descriptive) “App not installed” error on singed Only Signed apks

Off the top of my head, Android builds use proguard to obfusticate and strip unused code/files from the build. If you’re missing a file that exists before proguard does it’s thing, I’d look to that. As far as I’m aware, it has separate settings for debug and build states. It may be that it’s more aggressive in build mode.

Figured out: It was a problem related to not completely uninstalling my apks. HOWEVER: android app bundles still fail to include the file, even after putting useProguard false in the app gradle.

It’s somethng wrong with the bundle process.

Edit: And you can’t even copy the file into the bundle because of validation problems

Not related but I had similar problem missing version.properties
problem with proguard when I did release apk. Adding following in proguard rules seems to fix it

-keeppackagenames com.jme3.system
-adaptresourcefilenames *.properties