最近混淆打包c(diǎn)ocos代碼的時(shí)候遇到一個(gè)問(wèn)題,混淆后怎么也打不了包,不混淆就可以,經(jīng)過(guò)多方排查,謹(jǐn)以此記錄一下問(wèn)題的解決方法。
一、問(wèn)題描述
在打包c(diǎn)ocos的Android的release版的時(shí)候出現(xiàn)以下錯(cuò)誤:
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.
:sample:transformClassesAndResourcesWithProguardForRelease FAILED
Error:Execution failed for task ':sample:transformClassesAndResourcesWithProguardForRelease'.
java.io.IOException: Please correct the above warnings first.
Information:BUILD FAILED
二、解決方案
在確認(rèn)相關(guān)控件的混淆添加無(wú)誤后,又經(jīng)過(guò)一系列谷歌的答案搜索,最后的解決方案如下:
在proguard-android.txt
中添加-ignorewarnings
。
三、問(wèn)題原因
-ignorewarnings ,這句話(huà)是去除apk運(yùn)行時(shí)產(chǎn)生的警告導(dǎo)致程序異常終止,這是代碼混淆造成的。
-----參考出處