Proguard Android using Action Bar Sherlock

邮差的信 提交于 2019-12-03 17:33:53
Haresh Chaudhary

I have answered this before here, I am putting it here too so that it may help someone.

I had the same issue and read somewhere a workaround to this issue and it was to disable minifyEnabled, generate signed APK.

buildTypes {
    release {
        minifyEnabled false
        shrinkResources true
        proguardFiles 'proguard-project.txt'
    }

I never face this issue before updating buildTool to 23.0.

Also, with this newer version, you need to add this to your Progaurd.txt file.

-keep public class com.google.android.gms.* { public *; }
-dontwarn com.google.android.gms.**

Hope this helps to resolve your issue too.

Some classes like org.apache.commons.logging.LogFactory are missing from your libraries. Apparently, your application doesn't use them anyway, so you can tell ProGuard it's okay. For instance:

-dontwarn org.apache.commons.**

See the ProGuard manual > Troubleshooting > Warning: can't find referenced class.

Other classes like org.apache.http.** are already present in the Android runtime. You shouldn't duplicate them in your application libraries, since the versions in the Android runtime get precedence anyway.

See the ProGuard manual > Troubleshooting > Warning: library class ... depends on program class ...

Finally, you shouldn't specify -injars or -libraryjars options in your configuration file. The Ant/Eclipse/Gradle build process already automatically specifies all the necessary -injars, -outjars, and -libraryjars for you, based on the contents of your project.

See the ProGuard manual > Troubleshooting > Note: duplicate definition of program/library class

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!