Can't Run Basic Test App

I can’t seem to run the basic app when creating a new project. Spent lot’s of time setting everything up, it sends the package to the phone and I manually start it from the launcher on my android (droidx) but I get an error saying my activity has unexpectedly stopped. Tried to launch it again with the DDMS running and this is the error that is related to my crash:

12-06 00:58:52.762: E/AndroidRuntime(27712): Caused by: java.lang.ClassNotFoundException: com.relishstudios.spacetrain.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.relishstudios.spacetrain-2.apk]



Thanks in advance for any help received.

You’re supposed to put the main class in the Harness, not the MainActivity… Why not use the SDK? It correctly enters the main class for you.

I didn’t see that in the directions I was following from here https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:android

I am using the sdk, started a project then added mobile to it through the properties. Could you please post a link about setting it up properly.

That sets it up automatically, make sure the main class is properly set for your application. When you create a new project thats mygame.Main.

Clarifying where I’m at. Started a new JME3 project, then went to properties and checked build for android. It added the android manifest and properties to important files. I can run the example as a desktop appliction, and it compiles the android version and sends it to my phone and that error occurs.



[java] public static void main(String[] args) {

Main app = new Main();

app.start();[/java]



there is only one source package and it is mygame.Main.java. Where do I learn more about the Harness

The MainActivity extends the jME harness and should have the main class (which should extend Application at the same time) of the project set, check the content and make sure the appClass=“mygame.Main” is correct. When you enable the android deployment this is taken from the “Run” settings, so unless you have put a wrong main class there it should put “mygame.Main” automatically.

The only thing I changed from the tutorial was changing the name of the android application package from com.mygame.MAIN, to com.relishstudio.spacetrain. Everything should be default options

I’m about to just repeat the process with a new project.



Hey Normen, I appreciate your help allot.

The name of the android application package isn’t com.mygame.MAIN by default. You seem to do something (maybe unconsciously) that breaks the preset. Where do you enter that “android application package”? You normally just set it once during the project creation, it has nothing to do with the name of your projects classes or the main class. As said, the main class is set from the setting being set in the “Run” section. When you try it again, don’t try to “fix” anything, android deployment should just work for an application that properly runs on desktop when you enable it.

Alright so repeating the process did the job 8) The first time the Android MainActivity file wasn’t under the important files node.



Now to see what I can do with out breaking it, quite excited.