在 JavaFXPorts 中更改 minSdkVersion 不起作用

Changing minSdkVersion in JavaFXPorts doesn't work

关于 Android 的应用最小 sdk,我有一个奇怪的问题。 由于某些原因,build.gradle 中的更改不会影响项目的编译

我收到了很多方法的以下警告:

defining a default interface method requires --min-sdk-version >= 24 (currently 13)

结果我得到以下错误:

Too many classes in --main-dex-list, main dex capacity exceeded

这真的很烦人,因为我已经更改了最低要求。

build.gradle:

buildscript {
    repositories {
        jcenter()
        google()
        maven {
            url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
        }
    }
    dependencies {
        classpath 'org.javafxports:jfxmobile-plugin:2.0.8'
    }
}

apply plugin: 'scala'
apply plugin: 'org.javafxports.jfxmobile'

configurations {
    scalaCompiler
}
configurations.scalaCompiler.transitive = false

compileScala.targetCompatibility = "1.8"

mainClassName = 'sfxml.Main'

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

dependencies {
    compile('org.scala-lang:scala-library:2.12.6'){transitive = false}
    compile(group: 'org.scalafx', name: 'scalafx_2.12', version: '8.0.144-R12'){transitive = false}
    compile group: 'org.scalafx', name: 'scalafxml-core-sfx8_2.12', version: '0.4'

    scalaCompiler "org.scalamacros:paradise_2.12.6:2.1.1"

//    testCompile group: 'junit', name: 'junit', version: '4.12'
}

String scalaCompilerOptions="-Xplugin:$configurations.scalaCompiler.singleFile.path"
compileScala.scalaCompileOptions.additionalParameters = [scalaCompilerOptions]
compileTestScala.scalaCompileOptions.additionalParameters = [scalaCompilerOptions]



jfxmobile {
    android {
        manifest = 'src/android/AndroidManifest.xml'
        minSdkVersion '28'
        compileSdkVersion '28'
        buildToolsVersion '28.0.0'
        dexOptions {
            javaMaxHeapSize '3g'
        }
    }
}

Manifest.xml:

<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="sfxml" android:versionCode="1" android:versionName="1.0">
        <supports-screens android:xlargeScreens="true"/>
        <uses-permission android:name="android.permission.INTERNET"/>
        <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
        <uses-sdk android:minSdkVersion="28" android:targetSdkVersion="28"/>
        <application android:label="Test2" android:name="android.support.multidex.MultiDexApplication">
                <activity android:name="javafxports.android.FXActivity" android:label="Test2" android:configChanges="orientation|screenSize">
                        <meta-data android:name="main.class" android:value="sfxml.Main"/>
                        <meta-data android:name="debug.port" android:value="0"/>
                        <intent-filter>
                                <action android:name="android.intent.action.MAIN"/>
                                <category android:name="android.intent.category.LAUNCHER"/>
                        </intent-filter>
                </activity>
        </application>
</manifest>

一切正常,当我只是为桌面编译时。我在这里错过了什么?为什么 Gradle 或 JavaFXPorts 无法识别这些更改?

如果您需要更多关于我要实现的目标的上下文,您可以阅读

此外:我在最新版本上使用 Intellij(如果有差异的话)

此外:我将项目设置配置为使用 JDK 9 和 Android-SDK 28

我找到了答案 here

您需要像这样使用 dex 选项:

android {
        manifest = <path/to/manifest>
        dexOptions {
            additionalParameters "--min-sdk-version=24"
        }
}