Hey Monkey Community! I am new to the engine, but I have a lot of programming experience. I been developing my app for desktop and it’s been running amazing, thanks to the great documentation and other posts, but android deployment becomes a little difficult. I have been creating my game using the command line and utilizing the correct jar files during compilation and running. I have created android apps using the command line just fine, even able to make android games using other engines the same way. So now onto the problems…
Using the jme3 stable 3.1 jars I get the following error when I run the apk
06-22 18:12:55.064 25867 25867 E AndroidRuntime: FATAL EXCEPTION: main
06-22 18:12:55.064 25867 25867 E AndroidRuntime: Process: com.marcus.base, PID: 25867
06-22 18:12:55.064 25867 25867 E AndroidRuntime: java.lang.ExceptionInInitializerError
06-22 18:12:55.064 25867 25867 E AndroidRuntime: at com.jme3.system.AppSettings.(AppSettings.java:150)
06-22 18:12:55.064 25867 25867 E AndroidRuntime: at com.jme3.app.AndroidHarness.onCreate(AndroidHarness.java:223)
This error can be solved by going into AppSettings and returning a generic string in the method referred to in the AppSettings class. Then after that it points to two other classes, that’s also fixed by returning strings in place of build number and another string value that should be found in version.properties file (which exists) but is not being read I believe.
However the issue that really has me at a standstill is the application throwing an exception and saying it cannot find /Interface/Fonts/Default.fnt. However that file is found in the appropriate location in the jme3-core jar. I’ve read other forum posts about this issue on jme 3.0, but saw that it was supposed to be fixed in 3.1.
Anyone with information please help me fix this issue and get my app running from the command line. My suspicion is that my application may not be search on the device properly. I remember seeing an error saying that a locator was not registered to AssetManager. So I tried registering AndroidLocator to the assetManager defined in DesktopAssetManager and the assetManager referred to in ImplHandler, however, I either get compile errors when using gradle or if I do it using javac and pointing the classpath to the libs it compiles but I get nulls at runtime.
Thank you to anyone who assist with this. Definitely the best game engine I’ve had the experience to use.
Edit 1:
Additional Info that may help is i’m testing on a device running Android 7.1.2
Yup I tried that. I think I learned that from your compiled posts to help android users, thanks for that by the way!
java.lang.ExceptionInInitializerError
E AndroidRuntime: at com.jme3.system.AppSettings.(AppSettings.java:150)
Is the initial error that I used dirty solutions to solve (replacing strings), so i’m willing to take another shot in the dark and say it’s just struggling to initialize properly. I can’t understand why when all of the jar files are in the correct places and I’m able to completely compile the java code and create an apk.
I just gave moving appClass line before super.onCreate() and I was still prompted with the initial error of:
06-25 11:04:13.423 25404 25404 E AndroidRuntime: FATAL EXCEPTION: main
06-25 11:04:13.423 25404 25404 E AndroidRuntime: Process: com.marcus.base, PID: 25404
06-25 11:04:13.423 25404 25404 E AndroidRuntime: java.lang.ExceptionInInitializerError
06-25 11:04:13.423 25404 25404 E AndroidRuntime: at com.jme3.system.AppSettings.<clinit>(AppSettings.java:150)
06-25 11:04:13.423 25404 25404 E AndroidRuntime: at com.jme3.app.AndroidHarness.onCreate(AndroidHarness.java:223)
06-25 11:04:13.423 25404 25404 E AndroidRuntime: at com.marcus.base.Driver.onCreate(Driver.java:16)
Could you please give more insight into referencing the Activity lifecycle or an example.
I was initially using API 25 and recently switched to 26 with no difference. Yeah I definitely consider these problems weird, cause I replicate the same compilation and apk build process with other apps with no problems. Closest I came to this issue was another library shaders weren’t being found just like this /Interface/Fonts/Default.fnt isn’t being found so I moved the shaders to an asset folder and called it within the application and it worked.
I just want to say thank you so much for all of the tips you’ve provided, and the flow chart is greatly appreciated!
Edit:
Other library as in another engine I was using.