Hi @all,
i tried to create an android app by using javafxports. i created the apk like in the tutorial here (
https://bitbucket.org/javafxports/android/wiki/Building%20and%20deploying%20JavaFX%20Applications)
so just 3 steps:
1. gradle createProject (with my parameters)
2. ant debug
3. install apk on the device
so the app is installed but there is only a black screen. the javafx application i tried to port is just a hello world application like this one (
http://docs.oracle.com/javafx/2/get_started/hello_world.htm)
in logcat there is the following error:
java.lang.NoSuchMethodError: no static method with name='reportException' signature='(Ljava/lang/Throwable;)V' in class Lcom/sun/glass/ui/lens/LensApplication;
at com.sun.glass.ui.lens.LensApplication._initIDs(Native Method)
at com.sun.glass.ui.lens.LensApplication.initLibrary(LensApplication.java:148)
at com.sun.glass.ui.lens.LensApplication.<clinit>(LensApplication.java:154)
at com.sun.glass.ui.lens.LensPlatformFactory.createApplication(LensPlatformFactory.java:45)
at com.sun.glass.ui.Application.Run(Application.java:104)
at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:274)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:127)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:163)
at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:47)
at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115)
at java.lang.Thread.run(Thread.java:841)
10-15 09:26:02.774: W/GLASS(29104): Throwing exception java/lang/RuntimeException 'Error in JNI code'
10-15 09:26:02.774: W/dalvikvm(29104): Exception Ljava/lang/RuntimeException; thrown while initializing Lcom/sun/glass/ui/lens/LensApplication;
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at javafxports.android.DalvikLauncher$1.run(DalvikLauncher.java:122)
at java.lang.Thread.run(Thread.java:841)
Caused by: java.lang.RuntimeException: java.lang.ExceptionInInitializerError
at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:284)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:127)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:163)
at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:47)
at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115)
... 1 more
Caused by: java.lang.ExceptionInInitializerError
at com.sun.glass.ui.lens.LensPlatformFactory.createApplication(LensPlatformFactory.java:45)
at com.sun.glass.ui.Application.Run(Application.java:104)
at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:274)
... 5 more
Caused by: java.lang.RuntimeException: Error in JNI code
at com.sun.glass.ui.lens.LensApplication._initIDs(Native Method)
at com.sun.glass.ui.lens.LensApplication.initLibrary(LensApplication.java:148)
at com.sun.glass.ui.lens.LensApplication.<clinit>(LensApplication.java:154)
... 8 more
and here is my project strukture and the files they are in my project after the command ant debug:
│ AndroidManifest.xml
│ ant.properties
│ build.xml
│ local.properties
│ proguard-project.txt
│ project.properties
│
├───app-libs
│ Application.jar
│ Application_classes.jar
│ Application_resources.jar
│ javafx3d.jar
│
├───assets
│ Application_dex.jar
│ Application_resources.jar
│ buildtime
│ javafx.platform.properties
│ javafx.properties
│
├───bin
│ │ AndroidManifest.xml
│ │ AndroidManifest.xml.d
│ │ build.prop
│ │ classes.dex
│ │ jarlist.cache
│ │ Javafx3d-debug-unaligned.apk
│ │ Javafx3d-debug-unaligned.apk.d
│ │ Javafx3d-debug.apk
│ │ Javafx3d.ap_
│ │ Javafx3d.ap_.d
│ │ proguard.txt
│ │
│ ├───app_dex
│ │ classes.dex
│ │ classes2.dex
│ │ classes3.dex
│ │
│ ├───classes
│ │ └───de
│ │ └───saxsys
│ │ └───android
│ │ └───javafx3d
│ │ BuildConfig.class
│ │ R$attr.class
│ │ R$drawable.class
│ │ R$string.class
│ │ R.class
│ │
│ ├───dexedLibs
│ └───res
│ ├───drawable-hdpi
│ │ ic_launcher.png
│ │
│ ├───drawable-ldpi
│ │ ic_launcher.png
│ │
│ ├───drawable-mdpi
│ │ ic_launcher.png
│ │
│ └───drawable-xhdpi
│ ic_launcher.png
│
├───gen
│ │ R.java.d
│ │
│ └───de
│ └───saxsys
│ └───android
│ └───javafx3d
│ BuildConfig.java
│ R.java
│
├───libs
│ │ jfxdvk.jar
│ │
│ └───armeabi
│ libactivity.so
│ libdecora_sse.so
│ libglass_lens_eglfb.so
│ libjavafx_font.so
│ libjavafx_font_freetype.so
│ libjavafx_iio.so
│ liblens_porting.so
│ libprism_common.so
│ libprism_es2_eglfb.so
│
├───res
│ ├───drawable-hdpi
│ │ ic_launcher.png
│ │
│ ├───drawable-ldpi
│ │ ic_launcher.png
│ │
│ ├───drawable-mdpi
│ │ ic_launcher.png
│ │
│ ├───drawable-xhdpi
│ │ ic_launcher.png
│ │
│ ├───layout
│ └───values
│ strings.xml
│
└───src
any idea? is something missing?
Thanks Stefan