I managed to build a JavaFX app using gradle and javafxport but the apk fail to install on my device.
Here is my build.gradle:
task wrapper(type: Wrapper) {
gradleVersion = '2.4'
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.0.0-b10'
}
}
apply plugin: 'org.javafxports.jfxmobile'
mainClassName = 'java.Main'
repositories {
jcenter()
}
jfxmobile {
ios {
forceLinkClasses = ['java.**.*']
}
android {
applicationPackage = 'com.superflush.java'
androidSdk = 'C:/Users/USERNAME/AppData/Local/Android/android-sdk'
}
}
My device is a Asus Zenfone2 running stock Android 5.0
It is a x86_64 so I suspect that might be an issue but im not sure how to diagnose. Any suggestion how to solve this problem?
I managed to get my hands on standard 4.4.2 ARM phone so it installs but it wont run (blackscreen) and here is the logcat error output at execution:
E/DalvikLauncher(12088): java.lang.ClassNotFoundException: Didn't find class "application.Main" on path: DexPathList[[zip file "/data/app/com.superflu
sh.java-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.superflush.java-2, /vendor/lib, /system/lib]]
E/DalvikLauncher(12088): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
E/DalvikLauncher(12088): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
E/DalvikLauncher(12088): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
E/DalvikLauncher(12088): at javafxports.android.DalvikLauncher.resolveApplicationClass(DalvikLauncher.java:232)
E/DalvikLauncher(12088): at javafxports.android.DalvikLauncher.launchApp(DalvikLauncher.java:134)
E/DalvikLauncher(12088): at javafxports.android.FXDalvikEntity.getLauncherAndLaunchApplication(FXDalvikEntity.java:118)
E/DalvikLauncher(12088): at javafxports.android.FXDalvikEntity.surfaceCreated(FXDalvikEntity.java:144)
E/DalvikLauncher(12088): at android.view.SurfaceView.updateWindow(SurfaceView.java:572)
E/DalvikLauncher(12088): at android.view.SurfaceView.access$000(SurfaceView.java:86)
E/DalvikLauncher(12088): at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:175)
E/DalvikLauncher(12088): at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:847)
E/DalvikLauncher(12088): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1871)
E/DalvikLauncher(12088): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000)
E/DalvikLauncher(12088): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5670)
E/DalvikLauncher(12088): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
E/DalvikLauncher(12088): at android.view.Choreographer.doCallbacks(Choreographer.java:574)
E/DalvikLauncher(12088): at android.view.Choreographer.doFrame(Choreographer.java:544)
E/DalvikLauncher(12088): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
E/DalvikLauncher(12088): at android.os.Handler.handleCallback(Handler.java:733)
E/DalvikLauncher(12088): at android.os.Handler.dispatchMessage(Handler.java:95)
E/DalvikLauncher(12088): at android.os.Looper.loop(Looper.java:136)
E/DalvikLauncher(12088): at android.app.ActivityThread.main(ActivityThread.java:5149)
E/DalvikLauncher(12088): at java.lang.reflect.Method.invokeNative(Native Method)
E/DalvikLauncher(12088): at java.lang.reflect.Method.invoke(Method.java:515)
E/DalvikLauncher(12088): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
E/DalvikLauncher(12088): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607)
E/DalvikLauncher(12088): at dalvik.system.NativeStart.main(Native Method)
Here is my project structure, Main.java being the main: