Android deployment via SDK checkbox is HERE!

Hey everyone! I first wanted to say how great I think this project is and I look forward to using it in the future. However, right now I am having some trouble getting the application working on my device. After following the excellent instructions, the compiler says that the build was successful and that it transferred successfully to my device (Samsung Captivate running 2.2):

http://i.imgur.com/Juyhx.jpg



After running the application on my phone, I get this error:

http://i.imgur.com/MnHFG.jpg



I know this can’t be correct because 1) the samsung captivate does have OpenGL2 and 2) JME Tests app on the market work perfectly fine on the same phone. This is the console log from the platform compiler:


init:
Deleting: C:UsersJohnDocumentsNetBeansProjectsSuperChessbuildbuilt-jar.properties
deps-jar:
Updating property file: C:UsersJohnDocumentsNetBeansProjectsSuperChessbuildbuilt-jar.properties
Compiling 1 source file to C:UsersJohnDocumentsNetBeansProjectsSuperChessbuildclasses
compile:
Copying 1 file to C:UsersJohnDocumentsNetBeansProjectsSuperChessbuild
Copy libraries to C:UsersJohnDocumentsNetBeansProjectsSuperChessdistlib.
Building jar: C:UsersJohnDocumentsNetBeansProjectsSuperChessdistMyGame.jar
To run this application from the command line without Ant, try:
java -jar "C:UsersJohnDocumentsNetBeansProjectsSuperChessdistMyGame.jar"
Copying 11 files to C:UsersJohnDocumentsNetBeansProjectsSuperChessmobilelibs
Copying 1 file to C:UsersJohnDocumentsNetBeansProjectsSuperChessmobilelibs
jar:
run-android:
Android SDK Tools Revision 12
Project Target: Android 2.2
API level: 8
Resolving library dependencies:
No library dependencies.


Importing rules file: toolsantmain_rules.xml
Creating output directories if needed...
Compiling aidl files into Java classes...
Compiling RenderScript files into Java classes and RenderScript bytecode...
Generating R.java / Manifest.java from the resources...
MyGame.compile:
Compiling 1 source file to C:UsersJohnDocumentsNetBeansProjectsSuperChessmobilebinclasses
Converting compiled files and external libraries into C:UsersJohnDocumentsNetBeansProjectsSuperChessmobilebinclasses.dex...
warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.xmlpull.v1.builder.impl.XmlDocumentImpl$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.xmlpull.v1.builder.impl.XmlElementImpl$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.xmlpull.v1.builder.impl.XmlElementImpl$2) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.xmlpull.v1.builder.impl.XmlElementImpl$3) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
Packaging resources
Creating full resource package...
Creating MyGame-debug-unaligned.apk and signing it with a debug key...
MyGame.debug:
Running zip align on final apk...
Debug Package: C:UsersJohnDocumentsNetBeansProjectsSuperChessmobilebinMyGame-debug.apk
MyGame.install:
Installing C:UsersJohnDocumentsNetBeansProjectsSuperChessmobilebinMyGame-debug.apk onto default emulator or device...
pkg: /data/local/tmp/MyGame-debug.apk
Success
333 KB/s (2174380 bytes in 6.359s)
BUILD SUCCESSFUL (total time: 35 seconds)


Any thoughts as to why it would do this?

Maybe try compiling with a more recent target version?

Thanks for the quick response! I took your suggestion and tried 2.3.3, 3.2, and various Google API levels as well with almost the same error. The only thing that changes in the error message is in: "Exception thrown in Thread[GLThread #,5,main]… " where # appears to change based upon the API level. So if I were running API Level 13 (3.2), the error reads: “Exception thrown in Thread[GLThread 17,5,main]” If I were running API level 8 (2.3.1), the error reads: “Exception thrown in Thread[GLThread 20,5,main]”. Any idea? I feel like I’m just not seeing something here.

No, I don’t have much experience with android personally, maybe @Larynx has an idea?

I just did the exact same method as I mentioned above using a Nexus S and I received the same error. Does anyone have any more ideas?

@thallium: Try ConfigType.LEGACY in MainActivity.java



@all Just found out that the android library plugin was not properly version-bumped when the core libraries were updated, so you might not have gotten all updates to the jMonkeyEngine3.jar for android since the plugin was changed last time. This is fixed in svn. The jMonkeyEngine3.jar for android will now be part of the “Project Engine” plugin that also contains the normal jMonkeyEngine3.jar and gets version-bumped automatically when theres changes in the engine.

Followed all instructions with a brand new build.



Get the following when running



init:

Deleting: C:UserslaptopDocumentsjMonkeyProjectsBasicGameAndroidbuildbuilt-jar.properties

deps-jar:

Updating property file: C:UserslaptopDocumentsjMonkeyProjectsBasicGameAndroidbuildbuilt-jar.properties

compile:

Copying 1 file to C:UserslaptopDocumentsjMonkeyProjectsBasicGameAndroidbuild

Copy libraries to C:UserslaptopDocumentsjMonkeyProjectsBasicGameAndroiddistlib.

To run this application from the command line without Ant, try:

java -jar “C:UserslaptopDocumentsjMonkeyProjectsBasicGameAndroiddistMyGame.jar”

Copying 11 files to C:UserslaptopDocumentsjMonkeyProjectsBasicGameAndroidmobilelibs

C:UserslaptopDocumentsjMonkeyProjectsBasicGameAndroidnbprojectmobile-impl.xml:37: Warning: Could not find file C:UserslaptopDocumentsjMonkeyProjectsBasicGameAndroid${libs.jme3-android.classpath} to copy.

BUILD FAILED (total time: 3 seconds)

Hm, the android libraries have not been added (no ${libs.jme3-android.classpath} variable), are you sure you updated everything? Try disabling android deployment, then press ok to apply, then enable it again. Look for exceptions when pressing ok the second time (warning sign in lower right)

The same problem.

I updated everything before try to build.





Copying 11 files to C:UsersvizitorDocumentsjMonkeyProjectsBasicGamemobilelibs

C:UsersvizitorDocumentsjMonkeyProjectsBasicGamenbprojectmobile-impl.xml:37: Warning: Could not find file C:UsersvizitorDocumentsjMonkeyProjectsBasicGame${libs.jme3-android.classpath} to copy.





When I tried disable android deployment and then pressed ok, i got that:



Unexpected Ecxception:

A java.lang.NullPointerException exception has occurred.



Details:

org.netbeans.modules.project.uiapi.CustomizerDialog$OptionListener.storePerformed(CustomizerDialog.java:335)

at org.netbeans.modules.project.uiapi.CustomizerDialog$OptionListener.storePerformed(CustomizerDialog.java:338)

at org.netbeans.modules.project.uiapi.CustomizerDialog$OptionListener.access$400(CustomizerDialog.java:239)

at org.netbeans.modules.project.uiapi.CustomizerDialog$OptionListener$2$1.run(CustomizerDialog.java:297)

at org.openide.util.Mutex.writeAccess(Mutex.java:397)

at org.netbeans.modules.project.uiapi.CustomizerDialog$OptionListener$2.run(CustomizerDialog.java:291)

at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1424)

[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1968)

The NPE is probably because the mobile-impl.xml file wasn’t created in the first place. Can you make sure the user rights to the nbproject folder are correct on your windows system? Apparently the project settings are not created on your system, I can’t reproduce this and for others android deployment on windows also works fine.

Oh, I’m sorry. I must been do restart after update. I haven’t seen any messages about that’s needed and just forgot.



Now I get that:



C:UsersvizitorDocumentsjMonkeyProjectsBasicGamenbprojectmobile-impl.xml:5: The following error occurred while executing this line:

C:Developmentandroid-sdk-windowstoolsantmain_rules.xml:486: The following error occurred while executing this line:

C:Developmentandroid-sdk-windowstoolsantmain_rules.xml:203: apply returned: 1

BUILD FAILED (total time: 27 seconds)

I created a new project and started it to build for android device. Build was SUCCESSFUL!

The problem is solved by recreating the project after installing the plug-ins.

Hi! I’ve just install Android Plugin everything like in instrucion and when i run Basic Game project on my emulator (android v2.3.3 ) i recive the info

The appliation MainActivity (process com.mycompany.mygame) has stopped unexpectedly. Please try again
. Any suggestions?

Try changing the configuration in the MainActivity as described above.

if you mean configType i’ve changed and still the same

Oh, emulator? Well its written everywhere, the emulator doesn’t support OpenGL2 so it doesn’t work for the apps. You need a device.

I create a new project from BaseGame it can be builded successfully with no errrors.

But if I try to add library jme3-adroidin Properties then I get an error.

When I disable “android deployment” then i get warning sign message in lower right:



String index out of range: -1





and exceptions:



1 error; aborting

C:UsersvizitorDocumentsjMonkeyProjectsBasicGame7nbprojectmobile-impl.xml:5: The following error occurred while executing this line:

C:Developmentandroid-sdk-windowstoolsantmain_rules.xml:486: The following error occurred while executing this line:

C:Developmentandroid-sdk-windowstoolsantmain_rules.xml:203: apply returned: 1

BUILD FAILED (total time: 25 seconds)



If I remove that library from libs list then this specific bug isn’t gone and i get that exception again.



Any ideas?

You are not supposed to add this library. rtfm

Ok, thx.



So…what should I do to be able to use for example com.jme3.input.android.AndroidInput in my project?

You only use it in the android part of the code.

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:android#using_android_specific_functions