我在javafx上使用最新的胶子版本在neatbeans中编写代码,当我在笔记本电脑中运行它时,程序没有问题,但是当我尝试在android中运行时
我发了这条消息
com.android.builder.packaging.DuplicateFileException:在APK META-INF / INDEX.LIST中复制的重复文件 文件1:C:\ Users \ User.gradle \ caches \ modules-2 \ files-2.1 \ org.javafxports \ dalvik-sdk \ 8.60.8 \ 6630ec66e4703c910ac3fd6151a8494c8b59186b \ unpacked \ dalvik-sdk \ rt \ lib \ ext \ jfxrt。罐 文件2:C:\ Users \ User.gradle \ _caches \ modules-2 \ files-2.1 \ org.javafxports \ dalvik-sdk \ 8.60.8 \ 6630ec66e4703c910ac3fd6151a8494c8b59186b \ unpacked \ dalvik-sdk \ rt \ lib \ ext \ jfxrt。罐
到目前为止,我正在使用最近的Android SDK版本,我在这个网站上尝试了许多解决方案:
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude '...'
and more...
但我仍然无法得到解决方案。
这是我的build.gladle文件
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.3.4'
}
}
apply plugin: 'org.javafxports.jfxmobile'
repositories {
jcenter()
maven {
url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
}
}
mainClassName = 'com.gluon_application.Gluon_Application'
dependencies {
compile 'com.gluonhq:charm:4.3.0'
compile 'eu.hansolo:Medusa:7.6'
compile 'com.google.api-client:google-api-client:1.22.0'
compile 'com.pi4j:pi4j-core:1.1'
compile 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.0.2'
compile 'de.jensd:fontawesomefx-commons:8.15'
compile 'de.jensd:fontawesomefx-controls:8.15'
}
jfxmobile {
downConfig {
version = '3.2.0'
// Do not edit the line below. Use Gluon Mobile Settings in your project context menu instead
plugins 'display', 'lifecycle', 'orientation', 'statusbar', 'storage'
}
javafxportsVersion = '8.60.8'
android {
manifest = 'src/android/AndroidManifest.xml'
dexOptions {
javaMaxHeapSize '3g'
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
ios {
infoPList = file('src/ios/Default-Info.plist')
forceLinkClasses = [
'com.gluonhq.**.*',
'javax.annotations.**.*',
'javax.inject.**.*',
'javax.json.**.*',
'org.glassfish.json.**.*'
]
}
}
我收到此错误包括使用示例代码“Hello world”
我应该在脚本中添加什么内容?
此致
答案 0 :(得分:2)
根据您发布的依赖项列表,这对我有用:
jfxmobile {
android {
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
}
}
}