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

后端 未结 5 776
青春惊慌失措
青春惊慌失措 2020-12-21 04:59

I\'ve updated to the new adt&sdk 20, and I\'m having problems with the new way Proguard is being used on Eclipse. I\'m not a pro with Proguard at all, yet I\'ve always u

相关标签:
5条回答
  • 2020-12-21 05:05

    The path of default config file has been changed to

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

    0 讨论(0)
  • 2020-12-21 05:09

    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 .
    0 讨论(0)
  • 2020-12-21 05:19

    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.

    0 讨论(0)
  • 2020-12-21 05:20

    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

    0 讨论(0)
  • 2020-12-21 05:26

    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.

    0 讨论(0)
提交回复
热议问题