2

this is another error am getting

FAILURE: Build failed with an exception.

  • What went wrong: ANDROID_HOME not specified. Either set it as a gradle property, a system environment variable or directly in your build.gradle by setting the extension jfxmobile.android.androidSdk.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

2
  • What did you try to fix this yourself? Did you set ANDROID_HOME?
    – Sjon
    Jul 13, 2015 at 13:58
  • Please include code from what you've tried and what causes the error. This is a question taken out of context so it's impossible to know exactly what help you need.
    – Gemtastic
    Jul 14, 2015 at 8:15

2 Answers 2

2

i think, you have to add your android path on your build.gradle . Here is my setting for the android part:

jfxmobile {
    android {
//        signingConfig {
//            storeFile file("")
//            storePassword ''
//            keyAlias ''
//            keyPassword ''
//        }
        applicationPackage = 'my.package.app.name'
        manifest = 'src/android/AndroidManifest.xml'
        resDirectory = 'src/android/res'
        androidSdk ="$System.env.HOME/android-sdks" // this is bassicly path to your android sdk
    }
}

Try it.

Regards,

Ivan

2

Since you haven't defined the OS you are using, I'll go ahead and include both.

Ubuntu (or any other Linux distro I think):

Add the following to your ~/.bashrc file.

First

nano ~/.bashrc

Then add the following in the last line

export ANDROID_HOME= "Enter you sdk path"

This path will end with a /Android/sdk/ For eg. mine is /home/Android/sdk/

Log out and log in again and presto, magic! If bashrc does not seem to work. Use profile instead ie ~/.profile

Remember to log out to allow changes to occur on startup.

Windows:

We can't define names to exported paths in Windows(as far as I know) so we need to include it in the build.gradle

jfxmobile {
   android {
    compileSdkVersion = '15'
    buildToolsVersion = '22.0.1'
    androidSdk = 'C:/Users/your username/AppData/Local/Android/sdk'
  }
ios {
    infoPList = file('src/ios/Default-Info.plist')
  }
}

And hey, there's the magic again!

If you installed Android somewhere else, point it to the correct direction. Use the gluon plugin for Netbeans. Its the best way I found for working with javafxports. It takes all headaches from customizing basic things out of the way.

Why set it globally in Ubuntu and not in the build.gradle file? Declaring it globally is an approach which means you don't have to repeat the same process again in a new project.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.