android: proguard obfuscating problems
I am having a problem trying to obfuscate my project with proguard.
I am exporting my project with eclipse, the project is on android 2.2 sdk, the default.properties are :
target=android-8
proguard.config=proguard.cfg
I am gettin开发者_如何学Pythong this error when I am trying to export the project:
Error: Unknown option '..(some ASCI symbols)... mykey ...(some ASCIIsymbols)..' in line 1 of file 'D:\workplace\keyfile', included from argument number 1
I have exported other projects and none of them gave me this error... How can I fix this?
It seems like one of your *.properties files specifies
proguard.config=keyfile
because it is being read as if it were a ProGuard configuration file.
Add the following lines to your proguard configuration.
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
Now your stack traces will include line numbers, and by using the retrace tool that ships with proguard (included in the Android SDK), you are able to debug like normal.
Note that even if you didn't use these two configuration options, retrace still can output useful information provided you have the mappings file, albeit not totally unambiguously.
Note: the file with the mappings is produced by the proguard configuration option:
-printmapping outputfile.txt
In the ant file shipped with the Android SDK, it is set to mapping.txt.
Good luck.
精彩评论