Getting error while generating the .apk file if proguard is ON

前端 未结 2 1326
挽巷
挽巷 2021-02-06 19:06

I am using proguard to obfuscate the code. I am getting the following error in console

Proguard returned with error code 1. See console
Warning: org.apache.cordo         


        
相关标签:
2条回答
  • 2021-02-06 19:21

    I fixed it by adding this in my proguard-project.txt

    -keep public class * extends com.phonegap.api.Plugin 
    -keep public class org.apache.cordova.DroidGap 
    -keep public class org.apache.cordova.** 
    -libraryjars /Users/Nasir/Desktop/libs/commons-codec.jar
    -dontwarn android.webkit.*
    
    0 讨论(0)
  • 2021-02-06 19:24

    You can add the following to your proguard-project.txt. It worked for me on Cordova (PhoneGap) 2.1:

    -keep public class * extends com.phonegap.api.Plugin 
    -keep public class * extends org.apache.cordova.api.Plugin 
    -keep public class org.apache.cordova.DroidGap 
    -keep public class org.apache.cordova.** 
    -libraryjars libs/commons-codec-1.7.jar
    -dontwarn android.webkit.*
    -dontwarn org.apache.**
    
    0 讨论(0)
提交回复
热议问题