Empty bin,libs,src folders after creating Android project using Javafx android-tools

亡梦爱人 提交于 2019-11-27 19:35:43

问题


After creating an Android project using Javafx android-tools, the folders bin, libs, and src were empty! I followed this tutorial: android / Building and deploying JavaFX Applications.

Have I missed something? Please help!


回答1:


I think that tutorial is quite old... Now you can just use the last plugin they have realeased.

Go to Getting Started site, and check you have everything in place. Basically, you will need:

  • JDK8u40 early access release installed, JAVA_HOME should be set with the JDK path.
  • Gradle 2.2.1 installed
  • Android SDK
  • Android Build Tools 21.1.1 using SDK Manager.
  • Gradle Plugin for NetBeans or your IDE (optional)
  • And the plugin which is a 'build.gradle' file.

build.gradle:

buildscript {
    repositories {
        jcenter()
        }

    dependencies {
        classpath 'org.javafxports:javafxmobile-plugin:1.0.0-rc3'
    }
}

apply plugin: 'javafxmobile'

mainClassName='org.javafxports.android.MainJavaFX'

repositories {
    jcenter()
}

jfxmobile {
    android {
        applicationPackage = 'org.javafxports.android'
        androidSdk = file ('<your path to android sdk>')
    }
}

You can try the Ensemble 8 project that you can download from here or clone the project, and see for yourself how easy it is to port this application to Android.

You can create the apk as easy as typing on command line:

gradlew android

or this to create the apk and install it on your android device if you have it connected:

gradlew androidInstall

Once you have tested it, you will want to create your own project. So now you can create new projects with the Gradle plugin. Assuming you use NetBeans, you can create first a root project, and then add an empty subproject. On this subproject you can add all your JavaFX sources and you should override the default gradle.build file with the one shown above, adapting the path to your packages.

You will need the gradlew files and folder from the ensemble project, or if you have gradle on your path, then you can build the apk with the same commands, but using gradle android.

Important considerations

The plugin works with the last JDK8 8u40, but it doesn't support all Java 8 features (Streams and Optional), while it supports Lambdas. On the contrary, it supports mainly all the JavaFX 8 features.

It's in working progress, so some issues may not been solved yet, and you can report any problem you may have.



来源:https://stackoverflow.com/questions/28491131/empty-bin-libs-src-folders-after-creating-android-project-using-javafx-android-t

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!