简体   繁体   English

生成签名的APK时出现Android错误

[英]Android Error while generating signed APK

When I Build APK or generate signed APK. 当我构建APK或生成签名的APK。 I get the following error. 我收到以下错误。 Any solution please ? 有什么办法吗?

Error:Execution failed for task ':app:dexguardRelease'. 错误:任务':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 java.io.IOException:无法读取[D:\\ Android Project \\ LOANWARE2 \\ app \\ build \\ intermediates \\ res \\ resources-release.ap _(;;;;;;! / 〜,!/ LICENSE,! /.。 /,!,!/picasa.ini,!/META-INF/NOTICE /.svn/,!/,!/ _ /,!/ LICENSE.TXT ,! / SCCS /,!/ META-INF /许可, !/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/ ,! 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 /客户/,!组织/阿帕奇/ HTTP / IMPL /康涅狄格州/,!组织/阿帕奇/ HTTP / IMPL /康涅狄格州/ tsccm /,!组织/阿帕奇/ HTTP / IMPL /饼干/,!组织/阿帕奇/ HTTP / impl / entity /,! org / apache / http / impl / io /,! org / apache / http / io / ,!org / apache / http / message / ,!org / apache / http / params / ,!org /阿帕奇/ HTTP /协议/,!组织/阿帕奇/ HTTP / UTIL /,COM / guardsquare / dexguard /运行/,!COM / guardsquare /,! /dexguard .pro,!lib/ dictionary .txt,!com/saikoa/ .properties,!proguard/ .properties,META-INF/services/ ,!META-INF/ ,!.hg**,! / dexguard .pro,!lib / 词典 .txt,!com / saikoa / .properties,!proguard / .properties,META-INF / services /,! META-INF /,!。hg ** ,! /.hg ,!.git**,! /.hg,!。git ** ,! /.git ,!.svn**,! /.git,!。svn ** ,! /.svn ,!CVS,!CVS/ ,! /.svn,!CVS,!CVS /,! /CVS,! / CVS ,! /CVS/ ,!.cvsignore,! / CVS /,!。cvsignore ,! /.cvsignore,!SCCS,!SCCS/ ,! /.cvsignore,!SCCS,!SCCS/,! /SCCS,! / SCCS ,! /SCCS/ ,! / SCCS /,! .orig,! .orig ,! ~, .class,lib/ / .so,res/raw/*.so,assets/ .so,! 〜, .class,lib / / .so,res / raw / * 。so ,assets / .so ,! .so,!.readme,! .so,.. readme 、! .keep,! 。保持,! .DS_Store,! .DS_Store ,! .aidl,! .aidl ,! .rs,! .rs ,! .rsh,! .rsh ,! .d,! .d ,! .java,! .java ,! .scala,! .scala ,! .scc,! .scc ,! .swp,! .swp ,! .bak,!**thumbs.db,!**picasa.ini,!**package.html,!**overview.html,! .bak,!** thumbs.db,!** picasa.ini,!** package.html,!** overview.html ,! .AIDL,! .AIDL ,! .RS,! .RS ,! .RSH,! .RSH ,! .D,! .D ,! .JAVA,! JAVA! .SCALA,! .SCALA ,! .SCC,! .SCC ,! .SWP,! .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.)) .BAK,!** THUMBS.DB,!** PICASA.INI,!** PACKAGE.HTML,!** OVERVIEW.HTML)](无法处理XML文件[AndroidManifest.xml]:文件似乎位于二进制XML格式。请检查是否包含默认的DexGuard应用程序配置(2字节UTF-8序列的无效字节2)。

try this one in your app/build.gradle file 在您的app / build.gradle文件中尝试这个

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 您还可以排除错误提及的其他文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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