The output jar is empty. Did you specify the proper '-keep' options?

我的梦境 提交于 2019-12-09 12:33:32

问题


I am trying to build a release APK file from ant and this is what i m getting in my console

D:\AndroidSDK\android-sdk_r18-windows\android-sdk-windows\tools\ant\build.xml:595: The following error occurred while executing this line:D:\AndroidSDK\android-sdk_r18windows\android-sdk-windows\tools\ant\build.xml:864: The output jar is empty. Did you specify the proper '-keep' options?

What is this error and how can i resolve it..M using the latest SDK(API-17) with Revision 21.1 All java_home,Ant_home are set


回答1:


For library projects, I needed to add -dontshrink option to proguard config file - proguard was shrinking ALL my classes.




回答2:


When using gradle build system, there is no need to modify proguard-rules.pro.

Just inside specified buildType define minifyEnabled false. Example:

buildTypes {
    release {
        minifyEnabled false
    }
}



回答3:


Ohkk I got the answer myself..There was a problem in the Manifest file on the jar project which i was using as a library..The created the lib project,Updated it and referenced it to my main code .As in this LInk..and it worked:-) here



来源:https://stackoverflow.com/questions/14869315/the-output-jar-is-empty-did-you-specify-the-proper-keep-options

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