Exporting an Android project while using proguard on adt&sdk 20

我是研究僧i 提交于 2019-11-29 14:51:11
Blundell

If it was working fine before and you haven't learnt Proguard, just change this line:

 proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

to this line:

 proguard.config=proguard.cfg

then you'll have your old Proguard setup back, I'd recommend updating though, it should just work unless your using some 3rd party jars? These are what is it saying is missing and you should use the -keep flag to stop Proguard from removing them when it obfuscates.

android developer

Ok , the solution is that for some reason , I had the wrong location set for sdk.dir variable on eclipse.

So what I did is to:

  1. Go to eclipse's preferences
  2. Searched for variables
  3. And went to java->build path->classpath variables
  4. And added "sdk.dir" variable with the value of the directory of android sdk .

create a file proguard.cfg in your project root folder and update your adt to 21 and use proguard v4.8 or 4.9 and dont forget to run Android Lint before exporting APK

The path of default config file has been changed to

${sdk.dir}/tools/proguard/proguard-android-optimize.txt

Using SDK 22, my solution was to copy proguard-project.txt from ${sdk.dir}/tools/proguard/ into my project workspace.

If you look at project.properties, you see that it references ${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt.

It found ${sdk.dir} just fine, but was looking for proguard-project.txt in the project directory.

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