简体   繁体   中英

Android Error while generating signed APK

When I Build APK or generate signed APK. I get the following error. Any solution please ?

Error:Execution failed for task ':app:dexguardRelease'.

java.io.IOException: Can't read [D:\\Android Project\\LOANWARE2\\app\\build\\intermediates\\res\\resources-release.ap_(;;;;;;! / ~,!/LICENSE,! /. / ,! /picasa.ini,!/META-INF/NOTICE,! /.svn/ ,! /. ,! /_ / ,!/LICENSE.txt,! /SCCS/ ,!/META-INF/LICENCE,!/NOTICE.txt,! /about.html,! /thumbs.db,!/META-INF/LICENSE.txt,!/NOTICE,! /CVS/ ,! /package.html,!/META-INF/NOTICE.txt,! /overview.html,!org/w3c/dom/ ,!org/w3c/dom/ls/ ,!org/xml/sax/ ,!org/xmlpull/v1/ ,!org/json/JSON*,!org/apache/commons/logging/Log.class,org/apache/http/Consts.class,org/apache/http/HttpHeaders.class,org/apache/http/entity/ContentType.class,org/apache/http/util/Args.class,org/apache/http/util/Asserts.class,org/apache/http/util/CharsetUtils.class,org/apache/http/util/NetUtils.class,org/apache/http/util/TextUtils.class,!org/apache/http/ ,!org/apache/http/auth/ ,!org/apache/http/auth/params/ ,!org/apache/http/client/ ,!org/apache/http/client/entity/ ,!org/apache/http/client/methods/ ,!org/apache/http/client/params/ ,!org/apache/http/cl ient/protocol/ ,!org/apache/http/client/utils/ Utils.class,!org/apache/http/conn/ ,!org/apache/http/conn/params/ ,!org/apache/http/conn/routing/ ,!org/apache/http/conn/scheme/ ,!org/apache/http/conn/ssl/ ,!org/apache/http/conn/util/ ,!org/apache/http/cookie/ ,!org/apache/http/cookie/params/ ,!org/apache/http/entity/ ,!org/apache/http/impl/ ,!org/apache/http/impl/auth/ ,!org/apache/http/impl/client/ ,!org/apache/http/impl/conn/ ,!org/apache/http/impl/conn/tsccm/ ,!org/apache/http/impl/cookie/ ,!org/apache/http/impl/entity/ ,!org/apache/http/impl/io/ ,!org/apache/http/io/ ,!org/apache/http/message/ ,!org/apache/http/params/ ,!org/apache/http/protocol/ ,!org/apache/http/util/ ,com/guardsquare/dexguard/runtime/ ,!com/guardsquare/ ,! /dexguard .pro,!lib/ dictionary .txt,!com/saikoa/ .properties,!proguard/ .properties,META-INF/services/ ,!META-INF/ ,!.hg**,! /.hg ,!.git**,! /.git ,!.svn**,! /.svn ,!CVS,!CVS/ ,! /CVS,! /CVS/ ,!.cvsignore,! /.cvsignore,!SCCS,!SCCS/ ,! /SCCS,! /SCCS/ ,! .orig,! ~, .class,lib/ / .so,res/raw/*.so,assets/ .so,! .so,!.readme,! .keep,! .DS_Store,! .aidl,! .rs,! .rsh,! .d,! .java,! .scala,! .scc,! .swp,! .bak,!**thumbs.db,!**picasa.ini,!**package.html,!**overview.html,! .AIDL,! .RS,! .RSH,! .D,! .JAVA,! .SCALA,! .SCC,! .SWP,! .BAK,!**THUMBS.DB,!**PICASA.INI,!**PACKAGE.HTML,!**OVERVIEW.HTML)] (Can't process XML file [AndroidManifest.xml]: file appears to be in binary XML format. Please check if you have included a default DexGuard application configuration. (Invalid byte 2 of 2-byte UTF-8 sequence.))

try this one in your app/build.gradle file

android{
...
packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
        exclude 'META-INF/services/javax.annotation.processing.Processor'
    }

...
}

you can also exclude other files mentioned in error

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM