android:proguard混淆问题
我在尝试用 proguard 混淆我的项目时遇到问题。
我正在使用 eclipse 导出我的项目,该项目位于 android 2.2 sdk 上,default.properties 是:
target=android-8
proguard.config=proguard.cfg
当我尝试导出项目时,我收到此错误:
Error: Unknown option '..(some ASCI symbols)... mykey ...(some ASCIIsymbols)..' in line 1 of file 'D:\workplace\keyfile', included from argument number 1
我已导出其他项目,但没有一个项目给我此错误。 .. 我该如何解决这个问题?
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 getting 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来您的 *.properties 文件之一指定了,
因为它被读取为就好像它是 ProGuard 配置文件一样。
It seems like one of your *.properties files specifies
because it is being read as if it were a ProGuard configuration file.
将以下行添加到您的 proguard 配置中。
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
现在,您的堆栈跟踪将包括行号,并且通过使用 proguard 附带的 retrace 工具(包含在 Android SDK 中),您可以像平常一样进行调试。
请注意,即使您没有使用这两个配置选项,只要您有映射文件,retrace 仍然可以输出有用的信息,尽管并不完全明确。
注意:带有映射的文件是由 proguard 配置选项生成的:
-printmapping outputfile.txt
在 Android SDK 附带的 ant 文件中,它被设置为 mapping.txt。
祝你好运。
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.