3

I would like to develop an Android app using the Gluon Mobile framework.

I installed the Gluon plugin in my Netbeans IDE, created a sample project and built it successfully.

Now I would like to deploy the app to an Android device. I'm referring to the online documentation [1]: http://docs.gluonhq.com/charm/4.2.0/#_getting_started

As in [1], section "2.1.3. Android", I downloaded Android Studio 2.2.3 and installed the build-tools version 23.0.1 and the SDK Platform for API 21 from the Android SDK Manager.

However I can't see/install the "Android Support Library" from the Extras menu (Yes, I marked the "Obsolete" box).

Not surprisingly, I get the following error message, when I use "right click on my Netbeans-Project -> Tasks -> android -> android":

FAILURE: Build failed with an exception.

  • What went wrong: Failed to capture snapshot of input files for task 'mergeClassesIntoJar' during up-to-date check. java.io.FileNotFoundException: C:\Users...\AppData\Local\Android\sdk\extras\android\support\multidex\library\libs\android-support-multidex.jar (Das System kann den angegebenen Pfad nicht finden)

Indeed, the file "android-support-multidex.jar" is not available since the "Android Support Library" is not installed.

How can I install the "Android Support Library"?

Any help is very much appreciated!

vhlng
  • 33
  • 1
  • 3

1 Answers1

4

It has been asked here and here, but since the answers are in different contexts, maybe it's worthy having a summary here.

Up until version 1.2.0, the jfxmobile plugin has been working with the obsolete Android Support Library.

Now this library is not only obsolete but not available any more for download.

The current version of the jfxmobile plugin is 1.3.2, and it includes the required changes to work without that library, and use the multidex-1.0.1.aar library instead.

To make it work, just follow these steps:

  • Open the Android SDK Manager and make sure you have installed Extras/Google Repository and Extras/Android Support Repository.

  • Make sure you have this library: ANDROID_HOME/extras/android/m2repository/com/android/support/multidex/1.0.1/multidex-1.0.1.aar.

Now on your project:

  • Update the build.gradle file of your project to use the jfxmobile plugin current 1.3.2 version

  • If you add to the android configuration the android SDK path, you should move it to a properties file. For that, just create a properties file under C:\Users\<user>\.gradle\gradle.properties, and add the ANDROID_HOME variable: ANDROID_HOME=C:/<path.to.Android>/sdk. And remove the androidSdk from the android block if it was added.

  • Save and reload your project so the new configuration takes place (On the projects tab, root of the project, right click, Reload Project).

EDIT

If you are on Windows, make sure that Android SDK is installed under a location where gradle will have enough permissions to create folders and extract the .aar file.

Community
  • 1
  • 1
José Pereda
  • 44,311
  • 7
  • 104
  • 132
  • Thank you for your quick and helpful answer, José! Everything works fine. One small correction. The file multidex-1.0.1.aar is located in here: ANDROID_HOME/extras/android/m2repository/com/android/support/multidex/1.0.1/multidex-1.0.1.aar – vhlng Feb 09 '17 at 19:36
  • I also just changed my gradle.build to use 1.3.2 instead of 1.1.1. I installed the 2 extras packages and uninstalled the obsolete one. I removed the androidSdk line from the build file and added the properties file like you said with `ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk`. When i refreh the grdle project eclipse gives me the error `Failed to apply plugin [id 'org.javafxports.jfxmobile'] java.net.URISyntaxException: Illegal character in opaque part at index 9: C:Program Files (x86)Androidandroid-sdk/extras/m2repository`. I'm on windows 10. – Mark Feb 12 '17 at 16:44
  • @Mark try with slashes "/" instead. – José Pereda Feb 12 '17 at 19:10
  • Now i get `Unable to create base directory to explode aar into: C:\Program Files (x86)\Android\android-sdk\extras\android\m2repository\com\android\support\multidex\1.0.1\exploded` – Mark Feb 12 '17 at 19:13
  • @Mark maybe you don't have permissions to create folder under Program Files. Anyway this is not the place to solve your issue, create a new question if you still have problems. – José Pereda Feb 12 '17 at 19:19
  • Apparently so. Had to uninstall and reinstall everything out of program files. `/` is the right one as you said. maybe add that to the answer unless it's obvious to everyone else. thanks a lot! – Mark Feb 12 '17 at 20:54
  • Ok, I've updated the answer, I think your issue has to be taken into account. – José Pereda Feb 12 '17 at 21:08
  • It didn't work for me at first because I used a backslash. You CAN use backslashes, but you have to use double backslashes, or just resort to normal slashes ^^ – xeruf Oct 21 '17 at 09:42