Gluon javafx与netbeans错误android install

时间:2017-07-08 20:24:29

标签: gluon-mobile

尝试安装android时出错   任务':mergeClassesIntoJar'。

的执行失败
  

无法展开ZIP' C:\ Users \ Path .. \ AppData \ Local \ Android \ sdk \ extras \ android \ support \ multidex \ library \ libs \ android-support-multidex.jar'因为它不存在。

Can any one pleas help am fed up of this issue no proper solution below is my code 
buildscript {
    repositories {

        jcenter()
    }
    dependencies {
        classpath 'org.javafxports:jfxmobile-plugin:1.0.9'

    }
}

apply plugin: 'org.javafxports.jfxmobile'

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

mainClassName = 'com.netbeansdemo.NetbeansDemo'

dependencies {
    compile 'com.gluonhq:charm:3.0.0'

    androidRuntime 'com.gluonhq:charm-android:3.0.0'
    iosRuntime 'com.gluonhq:charm-ios:3.0.0'
    desktopRuntime 'com.gluonhq:charm-desktop:3.0.0'
}

jfxmobile {
    android {
        manifest = 'src/android/AndroidManifest.xml'
        androidSdk = 'C:/Users/ee209275/AppData/Local/Android/Sdk'
    }
    ios {
        infoPList = file('src/ios/Default-Info.plist')
        forceLinkClasses = [
                'com.gluonhq.**.*',
                'io.datafx.**.*',
                'javax.annotations.**.*',
                'javax.inject.**.*',
                'javax.json.**.*',
                'org.glassfish.json.**.*'
        ]
    }
}

1 个答案:

答案 0 :(得分:0)

您需要更新IDE的Gluon插件,以便生成具有更新依赖项的项目。当前版本的插件是NetBeans和IntelliJ的2.5.0,Eclipse的2.4.0。

对于单个视图项目,这将是您将获得的build.gradle文件:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'org.javafxports:jfxmobile-plugin:1.3.6'
    }
}

apply plugin: 'org.javafxports.jfxmobile'

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

mainClassName = 'com.gluonhq.testplugin.GluonTestPlugin'

dependencies {
    compile 'com.gluonhq:charm:4.3.5'
}

jfxmobile {
    downConfig {
        version = '3.3.0'
        // Do not edit the line below. Use Gluon Mobile Settings in your project context menu instead
        plugins 'display', 'lifecycle', 'statusbar', 'storage'
    }
    android {
        manifest = 'src/android/AndroidManifest.xml'
    }
    ios {
        infoPList = file('src/ios/Default-Info.plist')
        forceLinkClasses = [
                'com.gluonhq.**.*',
                'javax.annotations.**.*',
                'javax.inject.**.*',
                'javax.json.**.*',
                'org.glassfish.json.**.*'
        ]
    }
}

Android SDK路径存在问题。这个question显示了如何解决它。

基本上:

  • 打开Android SDK Manager并确保已安装Extras / Google Repository和Extras / Android Support Repository。

  • 从build.gradle文件的android块中删除androidSdk行,并将其移动到属性文件中。为此,只需在C:\Users\<user>\.gradle\gradle.properties下创建一个属性文件,然后添加ANDROID_HOME变量:ANDROID_HOME=C:/<path.to.Android>/sdk

然后重新加载项目,看它是否适用于桌面,然后部署到移动设备。