Android Gradle Duplicate files copied in APK META-INF/license.txt

前端 未结 5 609
粉色の甜心
粉色の甜心 2020-12-24 01:57

I\'m going to add RESTful Web Service support with Spring to my Android application as described here https://spring.io/guides/gs/consuming-rest-android/.

This is to

5条回答
  •  [愿得一人]
    2020-12-24 02:22

    adding these lines helped me.

    shadowJar {
        // Filtering shadow jar contents by file pattern.
        exclude 'schemaorg_apache_xmlbeans/attribute/**'
        exclude 'schemaorg_apache_xmlbeans/attributegroup/**'
        exclude 'schemaorg_apache_xmlbeans/element/**'
        exclude 'schemaorg_apache_xmlbeans/identityconstraint/**'
        exclude 'schemaorg_apache_xmlbeans/javaname/**'
        exclude 'schemaorg_apache_xmlbeans/modelgroup/**'
        exclude 'schemaorg_apache_xmlbeans/namespace/**'
        exclude 'schemaorg_apache_xmlbeans/src/**'
        exclude 'schemaorg_apache_xmlbeans/system/sXML*/**'
        exclude 'schemaorg_apache_xmlbeans/system/s8C3F193EE11A2F798ACF65489B9E6078/**'
        exclude 'schemaorg_apache_xmlbeans/type/**'
    
        exclude 'repackage/**'
    
        exclude 'LICENSE.txt'
        exclude 'NOTICE.txt'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/maven/**'
    
        // these are only needed when handling Visio files, remove it if you would like to use Visio support
        dependencies {
            exclude(dependency('com.github.virtuald:curvesapi'))
            exclude(dependency('commons-codec:commons-codec'))
        }
    
        // Relocate javax dependencies so Android does not choke
        relocate 'javax.xml.namespace', 'org.apache.poi.javax.xml.namespace'
        relocate 'javax.xml.stream', 'org.apache.poi.javax.xml.stream'
        relocate 'javax.xml.XMLConstants', 'org.apache.poi.javax.xml.XMLConstants'
    }
    

提交回复
热议问题