3

The official Gluon docs say in the prerequisites for an Android build:

From the Android SDK Manager, install...from Extras the Android Support Library

However, it seems that this is retired from the sdk manager in lieu of the "Android Support Repository", a gradle repository. The javafxports plugin is apparently still looking for the old support library folder in the android SDK, as indicated by the error:

Cannot expand ZIP '<my AppData path>\Local\Android\sdk\extras\android\support\multidex\library\libs\android-support-multidex.jar' as it does not exist

which has this stackoverflow answer, indicating the sdk doesn't install it there anymore, even with "Obsolete" checked in the sdk manager. How can we get the javafxports gradle plugin to find the support library while it runs the 'android' build task? Sure we could manually move it there, but that'd be a really ugly process for using with a build server or dev team...

Community
  • 1
  • 1
voxoid
  • 1,164
  • 1
  • 14
  • 31
  • 2
    I've just pushed a fix for this in the jfxmobile plugin repository: https://bitbucket.org/javafxports/javafxmobile-plugin/commits/35c507a0916c7bef93f11fb9cb4e85938a0fe5f2. Using the latest snapshot build (1.3.0-SNAPSHOT) should already include this fix. – Joeri Sykora Dec 14 '16 at 12:11
  • Thank you, Joeri. In which repository would I find the snapshot? It doesn't seem to be in maven central. Or do I need to build the project for my own repo? – voxoid Dec 14 '16 at 20:22
  • 1
    You need `maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }` – José Pereda Dec 14 '16 at 23:45
  • @JoséPereda I have no idea what that means. Opening that url in the browser gives me a directory with weird subdirectories and no way to search. The question remains, where can I download the snapshot plugin? – Mark Jeronimus Dec 15 '16 at 08:25
  • Ok, I just had a brainwave and walked down the directory tree as the classpath of the plugin, and found the jar. Now I can't install the jar as a plugin because it doesn't have a `META-INF/plugin.xml` inside. In another brainwave I inserted your snippet into my `build.gradle` inside node `buildscript/repositories`, and it downloaded two files. It still fails though: `Could not resolve all dependencies for configuration ':androidRuntimeNoRetrolambdaCopy'. Could not find com.android.support:multidex:1.0.1.` – Mark Jeronimus Dec 15 '16 at 08:43
  • @MarkJeronimus see my answer below – José Pereda Dec 15 '16 at 09:06

1 Answers1

4

So far (current release version 1.2.0), the jfxmobile plugin has been working with the obsolete Android Support Library.

As now it is not only obsolete but not available any more for download, as Joeri Sykora commented, there is a snapshot available with a fix to use the new Support Repository.

Until release version 1.3.0 is out, you can use it providing you refer the repository to download this snapshot, so there is no need to download, build or install manually the plugin:

buildscript {
    repositories {
        maven {
            url 'https://oss.sonatype.org/content/repositories/snapshots'
        }
        jcenter()
    }
    dependencies {
        classpath 'org.javafxports:jfxmobile-plugin:1.3.0-SNAPSHOT'
    }
}

This will work if you have installed with the Android SDK Manager Extras/Google Repository: check your Android sdk path for this folder: ANDROID_HOME/extras/google/m2repository, and the Extras/Android Support Repository: check for ANDROID_HOME/extras/android/m2repository/com/android/support/multidex/1.0.1/multidex-1.0.1.aar

And don't forget to apply the changes in the build script to your gradle project (Sync button on top-left of Gradle window in IntelliJ).

Community
  • 1
  • 1
José Pereda
  • 44,311
  • 7
  • 104
  • 132
  • Thats what I have in gradle, and what gave the errors in my comment above. – Mark Jeronimus Dec 15 '16 at 09:15
  • Run your task with `--info` and see if you find this message printed on the console: `Adding $googleMavenRepository.absolutePath to project repositories` – José Pereda Dec 15 '16 at 10:01
  • It works after changing the location where the SDK path is defined to `~/.gradle/gradle.properties`, containing `ANDROID_HOME=/path/to/android-sdk-linux`. – Mark Jeronimus Dec 15 '16 at 11:27
  • @JoséPereda Thanks, worked! When will the non-snapshot 1.3.0 be released? – voxoid Dec 15 '16 at 17:43
  • Not sure about it. If you really need a release, have a look at [this](http://gluonhq.com/services/commercial-support/), there are monthly or daily releases depending on your needs. – José Pereda Dec 15 '16 at 17:50