0

When compiling my JavaFX project for Android in Netbeans I get the following error:

* What went wrong:
A problem occurred configuring root project ''.
> Could not resolve all dependencies for configuration ':androidRuntimeNoRetrolambdaCopy'.
   > Could not find com.android.support:multidex:1.0.1.
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/support/multidex/1.0.1/multidex-1.0.1.pom
         https://jcenter.bintray.com/com/android/support/multidex/1.0.1/multidex-1.0.1.jar
         http://nexus.gluonhq.com/nexus/content/repositories/releases/com/android/support/multidex/1.0.1/multidex-1.0.1.pom
         http://nexus.gluonhq.com/nexus/content/repositories/releases/com/android/support/multidex/1.0.1/multidex-1.0.1.jar
     Required by:
         ::unspecified

My build.gradle:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'org.javafxports:jfxmobile-plugin:1.3.1'
    }
}

apply plugin: 'org.javafxports.jfxmobile'

repositories {
    jcenter()
    maven {
        url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
    }
}

mainClassName = 'com.gluonapplication.GluonApplication'

dependencies {
    compile 'com.gluonhq:charm:4.2.0'
}

jfxmobile {
    downConfig {
        version = '3.1.0'
        // Do not edit the line below. Use Gluon Mobile Settings in your project context menu instead
        plugins 'display', 'lifecycle', 'statusbar', 'storage'
    }
    android {
        manifest = 'src/android/AndroidManifest.xml'
androidSdk = 'C:/Users/mitch/AppData/Local/Android/sdk'
    }
    ios {
        infoPList = file('src/ios/Default-Info.plist')
        forceLinkClasses = [
                'com.gluonhq.**.*',
                'javax.annotations.**.*',
                'javax.inject.**.*',
                'javax.json.**.*',
                'org.glassfish.json.**.*'
        ]
    }
}

What I have tried: - Using a different version for jfxmobile (I used to have 1.2.0 which resulted in a successful build but when compiling for android results in:)

* What went wrong:
Failed to capture snapshot of input files for task 'mergeClassesIntoJar' during up-to-date check.
> java.io.FileNotFoundException: C:\Users\mitch\AppData\Local\Android\sdk\extras\android\support\multidex\library\libs\android-support-multidex.jar (The system cannot find the path specified)

Can anyone advise?

Community
  • 1
  • 1
CoderXYZ
  • 167
  • 2
  • 13
  • If you have installed Google Repository and Android Support repository, you should be able to find `ANDROID_HOME/extras/android/m2repository/com/android/support/multidex/1.0.1/multidex-1.0.1.aar`. Until you don't get this fixed you won't be able to solve the issue. – José Pereda Jan 07 '17 at 16:24
  • @JoséPereda Yes this file does indeed exist! I stumbled on it earlier but since it is not a .jar I thought it would be useless. Can you tell me what to do now that I have located the file? – CoderXYZ Jan 07 '17 at 16:27
  • Ask the answer you mentioned already says, create a gradle.properties file with the ANDROID_HOME path – José Pereda Jan 07 '17 at 16:32
  • @JoséPereda I already have the SDK defined as such: androidSdk = 'C:/Users/mitch/AppData/Local/Android/sdk' - Do i need to change this, the file is already in there – CoderXYZ Jan 07 '17 at 16:35
  • As I said, remove that from the build file and create the property file with it. – José Pereda Jan 07 '17 at 16:36
  • @JoséPereda EDIT: I aplogize for being stupid, it worked, thank you so mutch! Hopefully this helps others as well – CoderXYZ Jan 07 '17 at 16:43
  • Root directory? You need to place it in your user home folder `C:/Users/Mitch/.gradle/gradle.properties` – José Pereda Jan 07 '17 at 16:46
  • @JoséPereda I placed it in my app root directory, but the APK was created. Should I still move the properties file? – CoderXYZ Jan 07 '17 at 16:49
  • If you place it on your gradle home folder, you won't need to do it again for other projects – José Pereda Jan 07 '17 at 16:50
  • @JoséPereda many thanks! – CoderXYZ Jan 07 '17 at 18:11

0 Answers0