I'm having a hard time exactly what is causing this error on adb because I am using Kotlin, TornadoFX (a JavaFX Kotlin library) and Gluon with JFXMobile. When I use Gluon's androidInstall
to build my project I encounter this error, along with a black screen:
java.lang.ClassNotFoundException: Didn't find class "com.my.app.example.Main" on path: DexPathList
I'm trying to use JavaFX 3D in this application, but I don't think that it's causing the error.
I checked my Android Manifest, and the package name is the same as my project.
My project hierarchy is like so:
root
libs
src
android
ios
main
kotlin
com.my.app.example
Main.kt
Which might be causing Android to not be able to find the file? Since there's no Java folder.
I have all of the following in my gradle file, compiled successfully:
apply plugin: 'kotlin'
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'javafx-gradle-plugin'
apply plugin: 'org.javafxports.jfxmobile'
apply plugin: 'org.jetbrains.kotlin.android.extensions'
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
compile 'no.tornado:tornadofx:1.7.12'
compile 'no.tornado:tornadofx-android-compat:1.0.1'
compile 'com.gluonhq:charm:4.3.7'
compile fileTree(dir: 'libs', include: '*.jar')
}
The fileTree(dir: 'libs', include: '*.jar')
is for an external library that I am using to import ObjModels for JavaFX, located in the libs
folder of my project.
Things I am suspicious of causing this error:
- Me not having the right things in my Gradle file because I am terrible with Gradle.
- The .jar in my
libs
folder not being included correctly in the Android apk and messing it all up somehow - Kotlin file hierarchy somehow making Android not able to find the Main class, or the fact that it's Main.kt instead of Main.java
Please note that this project runs fine on my desktop, so it's not a problem with my source code, just something on the Android-specific end.
Any ideas what is causing this? Thanks for any help!