Duplicate files copied in APK META-INF/INDEX.LIST using Gluon

依然范特西╮ 提交于 2019-12-01 07:22:50

问题


I'm deloping a code in neatbeans on javafx with the latest gluon version, and when I run it in my laptop the program doesnt have problems, but when I try run in android

I achive this message

com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/INDEX.LIST File 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.jar File 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.jar

By now I'm using the recently Android's SDK version and I've tried many solutions propouse in this site like:

            exclude 'META-INF/LICENSE.txt'
            exclude 'META-INF/NOTICE.txt'
            exclude '...'
and more...

but I still cant get the solution.

This is my build.gladle file

    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.**.*'
        ]
    }
}

I get this error include using the sample code "Hello world"

What thing I should add in the script?

Regards


回答1:


With the list of dependencies you have posted, this works for me:

jfxmobile {
    android {    
        packagingOptions {
            exclude 'META-INF/LICENSE'
            exclude 'META-INF/LICENSE.txt'
            exclude 'META-INF/NOTICE'
            exclude 'META-INF/NOTICE.txt'    
        }   
    }
}


来源:https://stackoverflow.com/questions/42824478/duplicate-files-copied-in-apk-meta-inf-index-list-using-gluon

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!