JFXMuply插件不添加Android.jar和Javafxports jar



我在两个地方做一个项目,现在我在家工作。

在工作中,我在IntelliJ的外部库中看到了android.jar和jfx.jar(不知道确切的名称),并且这些类是可用的。然而,在家里,jar是不可见的,因此android类和JFXActivity类也不被识别。

我现在不知道Gradle为什么不加载它,build.Gradle是一样的。

build.gradle:

buildscript {
    repositories {
        jcenter()
        maven {
            url 'http://xxxx.com:8080/artifactory/plugins-release'
        }
    }
    dependencies {
        classpath 'org.javafxports:jfxmobile-plugin:1.0.8'
        classpath "org.jfrog.buildinfo:build-info-extractor-gradle:+"
    }
}
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'org.javafxports.jfxmobile'
artifactory {
    contextUrl = "${artifactory_contextUrl}"
    publish {
        repository {
            repoKey = 'libs-release-local'
            maven = true
        }
    }
    resolve {
        repository {
            repoKey = 'libs-release'
            maven = true
        }
    }
}
repositories {
    jcenter()
    mavenLocal()
    maven {
        url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
    }
}
mainClassName = 'com.xxxx.scan.application.gluon.MainApplication'
dependencies {
    compile 'com.gluonhq:charm:2.1.1'
    compile 'com.airhacks:afterburner.mfx:1.6.2'
    androidRuntime 'com.gluonhq:charm-android:2.1.1'
    iosRuntime 'com.gluonhq:charm-ios:2.1.1'
    desktopRuntime 'com.gluonhq:charm-desktop:2.1.1'
    compile(group: 'com.essers.pxl2016', name: 'scan-server-definition', version: '0.0.1-SNAPSHOT')
    compile(group: 'com.essers.pxl2016', name: 'client', version: '1.0-SNAPSHOT')
    compile(group: 'com.essers.pxl2016', name: 'configuration', version: '1.0-SNAPSHOT')
    compile('com.google.code.gson:gson:2.2.4')
    testCompile "junit:junit:4.12"
}
task print << {
    println("$System.env.ANDROID_HOME")
}
jfxmobile {
    android {
        androidSdk = "$System.env.ANDROID_HOME"
        manifest = 'src/android/AndroidManifest.xml'
        compileSdkVersion = 21
    }
    ios {
        infoPList = file('src/ios/Default-Info.plist')
        forceLinkClasses = [
                'com.xxxx.scan.application.gluon.**.*',
                'com.gluonhq.**.*',
                'io.datafx.**.*',
                'javax.annotations.**.*',
                'javax.inject.**.*',
                'javax.json.**.*',
                'org.glassfish.json.**.*'
        ]
    }
}
test {
    exclude 'com/xxxx/scan/application/gluon/**'
}

您在以下行中引用了Android SDK:

androidSdk = "$System.env.ANDROID_HOME"

确保SDK可以在那个位置找到,或者根据Gloon文档:引用它

你必须让jfxmobile插件知道在哪里可以找到Android SDK安装目录使用以下方式之一:

  • 在build.gradle 中的jfxmobile.android下定义的androidSdk属性

  • 名为ANDROID_HOME的gradle属性:在~/.gradle/gradle.properties中定义,或将-PANDROID_HOME传递给渐变构建

  • 名为ANDROID_HOME 的系统环境变量

jfxmobile插件将首先尝试查看androidSdk属性是否具有已设置。如果没有,它将查找ANDROID_HOME渐变属性并最终求助于ANDROID_ HOME系统环境变量。

我安装了IntelliJ 2016.1.2社区版,我可以确认所有依赖项都加载良好,包括android.jar、jfxdvk.jar和robovm-jar。由于某种原因,它在IntelliJ 15.0.6最终版本中失败了。

最新更新