Could not create gluon project for mobile using gradle

I followed the instructions http://docs.gluonhq.com/charm/4.0.1/#_getting_started . I am using eclipse 4.5.2 and JDK 1.8.0_102. I also downloaded Android Studio from the 24/25 API SDK from https://developer.android.com/studio/index.html#Other . Here is what I did:

  • download gradle 3.1 and set environment variables, so gradle -v returns the correct information.
  • The eclipse gluon plugin version 2.4.0 from http://download.gluonhq.com/tools/eclipse/release is installed
  • Buildship 1.0.21 installed from Buildship - http://download.eclipse.org/buildship/updates/e45/releases/1.0
  • created the gluon project, as shown in the tutorial and proven platforms: Android, iOS and the desktop. The project has been successfully created.
  • the menu "Show view"

    enter image description here

    and selected gradle tasks

  • the gradle task view looks different than in the tutorial:

    enter image description here

    I selected the GluonTest/application/run task and it works well on the desktop. But I can not find the tasks androidInstall and launchIOSDevice , as you can see in the picture.

Here is my gradle.build file:

 buildscript { repositories { jcenter() } dependencies { classpath 'org.javafxports:jfxmobile-plugin:1.1.1' } } apply plugin: 'org.javafxports.jfxmobile' repositories { jcenter() maven { url 'http://nexus.gluonhq.com/nexus/content/repositories/releases' } } mainClassName = 'gluon.main.GluonApplication' dependencies { compile 'com.gluonhq:charm:4.0.1' } jfxmobile { downConfig { version = '3.0.0' plugins 'display', 'lifecycle', 'statusbar', 'storage' } android { manifest = 'src/android/AndroidManifest.xml' androidSdk = 'C:/Users/Mark/AppData/Local/Android/sdk' } ios { infoPList = file('src/ios/Default-Info.plist') forceLinkClasses = [ 'com.gluonhq.**.*', 'javax.annotations.**.*', 'javax.inject.**.*', 'javax.json.**.*', 'org.glassfish.json.**.*' ] } } 

The only thing I changed was to add the line androidSdk = 'C:/Users/Mark/AppData/Local/Android/sdk' .

I understand that I still can’t build an iOS project, but I have to be able to build for android. How to do it?

+5
source share
1 answer

After updating Eclipse Mars, I can reproduce your problem, and the solution to return all tasks is easy:

Based on this thread , it seems that there are public and private tasks.

Thus, by default, only public tasks are visible (which are added to any group):

Default tasks

Click the down arrow icon to the right of the Tasks window:

4CrGh.png

Select Show All Tasks :

k8qrV.png

And you will have a new group: other with missing tasks like android , launchIOSDevice :

All tasks

+3
source

Source: https://habr.com/ru/post/1259020/


All Articles