使用IntelliJ的Android应用程序与Gluon / JavaFXPorts - Android设置不完整

时间:2017-10-09 14:15:34

标签: android intellij-idea gluon javafxports gluon-mobile

我刚刚在IntelliJ上创建了一个简单的应用程序,并且想知道为什么我的AndroidManifest.xml编辑器中有太多的红色着色。

我注意到,模块设置似乎有点偏。由于我还不是IntelliJ的专家,所以在打破Gradle之前我会先问一下。

简而言之:如何设置项目,以便我获得完整的Android支持,支持库和日志视图集成。

提前致谢。

#edit 要显示我的示例,请访问build.gradle文件。也许这有帮助。我也使用IntelliJ IDEA 2017.2.5。

buildscript {
    ext.kotlin_version = '1.1.4-3'
    repositories {
        jcenter()
        mavenCentral()
        mavenLocal()
    }
    dependencies {
        classpath 'org.javafxports:jfxmobile-plugin:1.3.8'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

plugins {
    id "com.github.ben-manes.versions" version "0.15.0"
}

dependencyUpdates.resolutionStrategy = {
    componentSelection { rules ->
        rules.all { ComponentSelection selection ->
            boolean rejected = ['alpha', 'alpha-preview', 'beta', 'rc', 'cr', 'm'].any { qualifier ->
                selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
            }
            if (rejected) {
                selection.reject('Release candidate')
            }
        }
    }
}

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

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

compileKotlin {
    kotlinOptions {
        jvmTarget = "1.8"
    }
}
compileTestKotlin {
    kotlinOptions {
        jvmTarget = "1.8"
    }
}

mainClassName = 'ch.cnlab.monitoring.cross.Main'
// preloaderClassName = 'ch.cnlab.monitoring.cross.Preloader'

dependencies {

    // local Maven dependency
    compile 'ch.cnlab.swag:fx-commons-core:1.0.0'
    compile 'ch.cnlab.swag:fx-commons-afterburner:1.0.0'

    // Gluon Charm
    compile 'com.gluonhq:charm:4.3.7'


    // compileNoRetrolambda removed, due to invoke dynamic calls within the newer API version
    compile 'com.airhacks:afterburner.mfx:1.6.3'

    // UI related
    compile 'org.controlsfx:controlsfx:8.40.13'
    compile 'de.jensd:fontawesomefx-commons:8.15'
    compile 'de.jensd:fontawesomefx-fontawesome:4.7.0-5'
    compile 'de.jensd:fontawesomefx-materialdesignfont:1.7.22-4'
    compile 'de.jensd:fontawesomefx-materialicons:2.2.0-5'
    compile 'de.jensd:fontawesomefx-controls:8.15'

    // JSON
    compile 'com.fasterxml.jackson.core:jackson-databind:2.9.0'
    // other
    compile 'commons-codec:commons-codec:1.10'
    // compile 'com.squareup.okhttp3:okhttp:3.5.0'

    // access to FXActivity
    compile 'org.javafxports:jfxdvk:8.60.9'
    androidRuntime 'org.javafxports:jfxdvk:8.60.9'

    // Kotlin
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
}

jfxmobile {
    downConfig {
        version = '3.6.0'
        // Do not edit the line below. Use Gluon Mobile Settings in your project context menu instead
        plugins 'display', 'lifecycle', 'statusbar', 'storage', 'barcode-scan', 'orientation', 'settings', 'browser', 'device',
                'local-notifications', 'push-notifications', 'runtime-args', 'share'
    }
    android {
        manifest = 'src/android/AndroidManifest.xml'
        // compileSdkVersion = 22
        // minSdkVersion = 19
        // targetSdkVersion = 22
        dexOptions {
            javaMaxHeapSize '2g'
        }
        packagingOptions {
            pickFirst 'META-INF/LICENSE'
            pickFirst 'META-INF/NOTICE'
            pickFirst 'license/LICENSE.txt'
        }
        signingConfig {
            storeFile file('signing/android/my-release-key.keystore')
            File propsFile = file('signing/android/keystore.properties');
            if (propsFile.exists()) {
                Properties props = new Properties();
                props.load(new FileInputStream(propsFile))
                storePassword props.getProperty('RELEASE_STORE_PASSWORD')
                keyAlias props.getProperty('RELEASE_KEY_ALIAS')
                keyPassword props.getProperty('RELEASE_KEY_PASSWORD')
            }
        }
    }
    ios {
        infoPList = file('src/ios/Default-Info.plist')
        forceLinkClasses = [
                'com.gluonhq.**.*',
                'de.jensd.**.*',
                'javax.annotations.**.*',
                'javax.inject.**.*',
                'javax.json.**.*',
                'javax.xml.**.*',
                'org.glassfish.json.**.*',
                'com.airhacks.**.*',
                'okio.**.*',
                'okhttp3.**.*',
                'com.fasterxml.**.*',
                'ch.cnlab.**.*'
        ]
    }
}

0 个答案:

没有答案