I still don’t know if this is enough to solve this issue, let me know what would you like to see as an example or a tutorial on android development with jMonkeyEngine and i will add it to this repo ?
If you are currently porting your game to android, let me know if there is a use-case you want to try ?
hints :
Would a Scala and/or Groovy examples be useful ?
Would a lemur example be useful ?
Would a Minie example be useful ?
Would a shader workflow example be useful ?
Or they are more like engine oriented and just gradle ?
EDIT :
This issue is also a similar target (although quite invalid for me, but will be resolved when simple examples are provided for sure) :
Not for me exactly, but the template I use for https://start.jmonkeyengine.org/ has trouble with lemur on android (if both lemur and lemur-proto are included android complains when it tries to merge everything) so if you have a working lemur android example that would be helpful for me to use to update the template
I have started the process of porting Advanced Vehicles to android recently, and yes some components of Lemur was buggy with android and i cannot remember which part (and mostly was incompatible dependencies), but as of Lemur basic setup, it was working !
As of this, i will start building some examples for lemur and will include them on different modules on this repository.
That’s because guava-19 is a duplicate, you can exclude it from the proto module.
Execution failed for task ':hellolemur:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
> Duplicate class com.google.common.util.concurrent.ListenableFuture found in modules jetified-guava-19.0 (com.google.guava:guava:19.0) and jetified-listenablefuture-1.0 (com.google.guava:listenablefuture:1.0)
Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.
I ran an android test today, lemur works on android, but lemur styles don’t work, due to missing javax.script.ScriptEngineManager from android system :
This exception is raised when trying to use BaseStyles.loadGlassStyle(); :
E/AndroidRuntime: FATAL EXCEPTION: GLThread 7236
Process: com.jme3.hellojmesurfaceview, PID: 6177
java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/script/ScriptEngineManager;
at com.simsilica.lemur.style.StyleLoader.<init>(StyleLoader.java:72)
at com.simsilica.lemur.style.StyleLoader.<init>(StyleLoader.java:62)
at com.simsilica.lemur.style.BaseStyles.loadStyleResources(BaseStyles.java:72)
at com.simsilica.lemur.style.BaseStyles.loadGlassStyle(BaseStyles.java:62)
at com.jme3.hellojmesurfaceview.MyGame.simpleInitApp(MyGame.java:48)
at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:240)
at com.jme3.view.surfaceview.JmeSurfaceView.initialize(JmeSurfaceView.java:294)
at com.jme3.system.android.OGLESContext.onDrawFrame(OGLESContext.java:344)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1573)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1272)
Caused by: java.lang.ClassNotFoundException: Didn't find class "javax.script.ScriptEngineManager" on path: DexPathList[[dex file "/data/data/com.jme3.hellojmesurfaceview/code_cache/.overlay/base.apk/classes2.dex", zip file "/data/app/~~c01C2qvFAtlfaA5P1zTbkg==/com.jme3.hellojmesurfaceview-YWYnzg8owki_m9SpjFZMWA==/base.apk"],nativeLibraryDirectories=[/data/app/~~c01C2qvFAtlfaA5P1zTbkg==/com.jme3.hellojmesurfaceview-YWYnzg8owki_m9SpjFZMWA==/lib/arm64, /data/app/~~c01C2qvFAtlfaA5P1zTbkg==/com.jme3.hellojmesurfaceview-YWYnzg8owki_m9SpjFZMWA==/base.apk!/lib/arm64-v8a, /system/lib64, /system/system_ext/lib64, /system/product/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.simsilica.lemur.style.StyleLoader.<init>(StyleLoader.java:72)
at com.simsilica.lemur.style.StyleLoader.<init>(StyleLoader.java:62)
at com.simsilica.lemur.style.BaseStyles.loadStyleResources(BaseStyles.java:72)
at com.simsilica.lemur.style.BaseStyles.loadGlassStyle(BaseStyles.java:62)
at com.jme3.hellojmesurfaceview.MyGame.simpleInitApp(MyGame.java:48)
at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:240)
at com.jme3.view.surfaceview.JmeSurfaceView.initialize(JmeSurfaceView.java:294)
at com.jme3.system.android.OGLESContext.onDrawFrame(OGLESContext.java:344)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1573)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1272)
I ran a precompiled groovy and scala before on android, don’t know if android can compile them, but gradle tasks can (you just need to add a compiler call before android tasks) !
Android doesn’t have javax.styles.* package, so have you tested this on android ?
Thanks for sharing, this may be helpful, i was compiling groovy externally with a bash script and then packaging it as a jar and including inside lib folder.
I think for using the gist file I linked above you do not need to use StyleLoader, just instantiate LemurGuiStyle class and it should apply the style but as said I have never used it before.
If you know a fix for lemur/lemur-proto duplicate res files please let me know, after that we will have a working example for lemur-proto together besides lemur on android .
Note: nothing requires you to use the groovy styles or default styles. You are free to hand-code styles in Java. No groovy required. Just don’t include the style resources and don’t load the glass style. Done.