Gluon Mobile项目不适用于gradle 6

问题描述 投票:1回答:1

我有一个带有build.gradle的Gluon移动项目,如下所示:

buildscript {
    repositories {
        jcenter()
        google()
        mavenCentral()
        maven {
            url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
        }
    }
    dependencies {
        classpath 'org.javafxports:jfxmobile-plugin:2.0.30'
        classpath 'com.google.gradle:osdetector-gradle-plugin:1.6.0'
        classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.2'
    }
}

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

apply plugin: 'application'
apply plugin: 'org.javafxports.jfxmobile'
apply plugin: 'com.google.osdetector'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'eclipse'

compileJava {
    doFirst {
        options.compilerArgs = [
                '--module-path', classpath.asPath,
                '--add-modules', 'javafx.controls'
        ]
    }
}

run {
    doFirst {
        jvmArgs = [
                '--module-path', classpath.asPath,
                '--add-modules', 'javafx.controls'
        ]
    }
}

sourceCompatibility = 13
targetCompatibility = 13

ext.platform = osdetector.os == 'osx' ? 'mac' : osdetector.os == 'windows' ? 'win' : osdetector.os

dependencies {
    compile "org.openjfx:javafx-base:13:$platform"
    compile "org.openjfx:javafx-graphics:13:$platform"
    compile "org.openjfx:javafx-controls:13:$platform"
    compile "org.openjfx:javafx-fxml:13:$platform"

    compile "org.openjfx:javafx-graphics:13:win"
    compile "org.openjfx:javafx-graphics:13:mac"
    compile "org.openjfx:javafx-graphics:13:linux"

    compile 'com.gluonhq:charm:5.0.0-jdk9'
    compile 'org.reactfx:reactfx:2.0-M5'
    compileOnly 'org.projectlombok:lombok:1.18.6'

    compile project(':GameClientLogic')
}

jfxmobile {
    downConfig {
        version = '3.8.6'
        plugins 'display', 'lifecycle', 'statusbar', 'storage'
    }
    android {
        compileSdkVersion = 23
        minSdkVersion = 23
//      manifest = 'src/android/AndroidManifest.xml'
        packagingOptions {
            pickFirst 'META-INF/*'
            pickFirst 'META-INF/**'
            pickFirst 'META-INF/INDEX.LIST'
            pickFirst 'META-INF/LICENSE'
            pickFirst 'META-INF/LICENSE.txt'
            pickFirst 'META-INF/NOTICE'
            pickFirst 'META-INF/DEPENDENCIES'
            pickFirst 'META-INF/NOTICE.txt'
            pickFirst 'META-INF/services/javax.ws.rs.ext.Providers'
        }
    }
    ios {
        infoPList = file('src/ios/Default-Info.plist')
        forceLinkClasses = [
                'com.gluonhq.**.*',
                'javax.annotations.**.*',
                'javax.inject.**.*',
                'javax.json.**.*',
                'org.glassfish.json.**.*'
        ]
    }
}

mainClassName = 'com.my.clientGUI.Main'
jar {
    manifest {
        attributes 'Main-Class': 'com.my.clientGUI.Main'
    }
    from {
        configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
    }
}

wrapper {
    gradleVersion = '6.0.1'
}

当我尝试执行gradle构建时,出现错误:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'ClientGUI'.
> Could not create task ':debug'.
   > Unnecessarily replacing a task that does not exist is not supported.  Use create() or register() directly instead.  You attempted to replace a task named 'debug', but there is no existing task with that name.

我没有在任何地方替换调试。问题出在哪里?我已经尝试删除.gradle文件夹,没有帮助。使用Eclipse 4.14。

我想要gradle 6,以便可以使用JDK 13。

java gradle gluon-mobile
1个回答
0
投票

问题是插件org.javafxports.jfxmobile与Gradle 6不兼容。降级Gradle版本5。

由于Gradle 5不支持Java 13,因此您还应该将Java降级为Java 11。

© www.soinside.com 2019 - 2024. All rights reserved.