Android studio 混淆打包时,出现Error:Execution failed for task ':app:proguardRelease'.
> java.io.IOException: Please correct the above warnings first.
Warning:org.apache.http.impl.conn.tsccm.RouteSpecificPool: can't find referenced class org.apache.commons.logging.LogFactory
Warning:org.apache.http.impl.conn.tsccm.RouteSpecificPool: can't find referenced class org.apache.commons.logging.Log
Warning:org.apache.http.impl.conn.tsccm.RouteSpecificPool: can't find referenced class org.apache.commons.logging.LogFactory
Warning:org.apache.http.impl.conn.tsccm.RouteSpecificPool: can't find referenced class org.apache.commons.logging.Log
Warning:org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager: can't find referenced class org.apache.commons.logging.LogFactory
Warning:org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager: can't find referenced class org.apache.commons.logging.Log
Warning:org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager: can't find referenced class org.apache.commons.logging.LogFactory
Warning:org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager: can't find referenced class org.apache.commons.logging.Log
Warning:org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager$1: can't find referenced class org.apache.commons.logging.Log
Warning:there were 210 unresolved references to classes or interfaces.
You may need to add missing library jars or update their versions.
If your code works fine without the missing classes, you can suppress
the warnings with '-dontwarn' options.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
Warning:there were 1 unresolved references to library class members.
You probably need to update the library versions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)
:app:proguardRelease FAILED
Error:Execution failed for task ':app:proguardRelease'.
> java.io.IOException: Please correct the above warnings first.
依照以往的管理,warn将其忽略就好了。但是现在不能忽略,影响打包的正常进行。
在官网找到这么一句话,Manual -> Troubleshooting -> “Warning: can’t find referenced class”,“try your luck with the -ignorewarnings option, or even the -dontwarn option”。
打开proguard-rules.txt,加入-dontwarn org.apache.http.**即可。
重新执行Generate Signed APK,打包成功!
当遇到IOException提示'Please correct the above warnings first.'时,不能忽视警告。根据官方建议,在proguard-rules.txt文件中添加'-dontwarn org.apache.http.**',然后可以成功执行Generate Signed APK并完成打包。

6535

被折叠的 条评论
为什么被折叠?



