Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaFX (jfxmobile) with gradle-android-scala-plugin gives me "The 'java' plugin has been applied, but it is not compatible with the Android plugins." #79

Open
voxoid0 opened this issue Feb 16, 2016 · 2 comments

Comments

@voxoid0
Copy link

voxoid0 commented Feb 16, 2016

I’m trying to build a Scala+JavaFX application for Android (the most awesomesterest cross-platform technology stack). I used the Gluon Eclipse plugin to create a “Basic Gluon Application”, then I followed the gradle-android-scala-plugin readme instructions.

When I run the androidInstall build task (from jfxmobile), I get the error "The 'java' plugin has been applied, but it is not compatible with the Android plugins." So apparently jfxmobile runs the java plugin; any ideas on how to make these two play nice?

My build script looks like this:

`

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'org.javafxports:jfxmobile-plugin:1.0.7'
        classpath "com.android.tools.build:gradle:1.3.1"
        classpath "jp.leafytree.gradle:gradle-android-scala-plugin:1.4"
    }
}

apply plugin: 'org.javafxports.jfxmobile'
//apply plugin: 'scala'
//apply plugin: 'eclipse'
apply plugin: "com.android.application"
apply plugin: "jp.leafytree.android-scala"

repositories {
    jcenter()
    mavenCentral()
    mavenLocal()
}


mainClassName = 'com.percebemusic.test.javafx.MainApplication'

jfxmobile {
    android {
        manifest = 'src/android/AndroidManifest.xml'
    }
    ios {
        infoPList = file('src/ios/Default-Info.plist')
    }
}

// see https://github.com/saturday06/gradle-android-scala-plugin
android {
    compileSdkVersion "android-21"
    buildToolsVersion "22.0.1"

    defaultConfig {
        targetSdkVersion 22
        testInstrumentationRunner "com.android.test.runner.MultiDexTestRunner"
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }

    productFlavors {
        dev {
            minSdkVersion 21 // To reduce compilation time
        }

        prod {
            minSdkVersion 8
        }
    }

    sourceSets {
        main {
            scala {
                srcDir "path/to/main/scala" // default: "src/main/scala"
            }
        }

        androidTest {
            scala {
                srcDir "path/to/androidTest/scala" // default: "src/androidTest/scala"
            }
        }
    }
}

dependencies{
    compile 'org.slf4j:slf4j-api:1.7.5'
    compile "org.scala-lang:scala-library:2.11.7"
    compile "com.android.support:multidex:1.0.1"    
    testCompile "junit:junit:4.11"
    androidTestCompile "com.android.support:multidex-instrumentation:1.0.1", { exclude module: "multidex" }
}


tasks.withType(ScalaCompile) {
    scalaCompileOptions.deprecation = false
    scalaCompileOptions.additionalParameters = ["-feature"]
}

`

@purplefishies
Copy link

I take it no progress on this ? I'm just trying to build using com.android.application and scala plugins and am getting the same error.

@voxoid0
Copy link
Author

voxoid0 commented Sep 19, 2016

I did eventually figure it out, though I don't remember the solution for this particular error, but perhaps the resulting overall guide would help you: http://joelbecker.net/blog/scala-javafx-on-android-ios-windows-osx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants