Android APK reports java.io.ioexception… Error during compilation. Solution

Before confusion compilation, my program can run normally. During confusion compilation, the following errors are reported:

Error:Execution Failed for task ‘:gviews:transformClassesAndResourcesWithProguardForRelease'.

Java.io.IOException: The same input jar [E:\Android\myProgram\angel\libs\alipaySdk-20160825.jar] is specified twice.

first

Take a look at the configuration of this jar in my project. I imported alipaysdk-20160825.jar in LIBS, as shown in the following figure:

Then, this jar is also configured in build.gradle. Compile files ('libs / alipaysdk-20160825. Jar ')

then

Before publishing APK, the APK should be obfuscated and compiled. For alipaysdk-20160825.jar, the obfuscation processing in the proguard-rules.pro file is as follows:

Alipay confusion

This is the confusion code provided by Alipay official. When running the program, it reported the error at the beginning.

processing method

Delete the line - libraryjars LIBS / alipaysdk-20160825.jar in the proguard-rules.pro folder. Only the handling method is written here, and the reason for doing so is not written here, because I can't accurately describe the reasons for such handling. If I say it incorrectly, it will mislead the person. Therefore, the handling method is given here, and the reasons are explored and thought together,

Thank you for reading, hope to help you, thank you for your support to this site!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>