proguard.ParseException:在Android Eclipse ADT中期望’@’之前的类成员名称

proguard.ParseException:在Android Eclipse ADT中期望’@’之前的类成员名称,第1张

概述我尝试使用Proguard在MAC上使用 eclipse ADT v21.1.0-569685来优化我的 Android应用程序代码. 我使用project-> Android Tools->导出已签名的应用程序包选项与我的私有证书签名,签署完成后我收到了以下错误, project.properties # This file is automatically generated by Andro 我尝试使用Proguard在MAC上使用 eclipse ADT v21.1.0-569685来优化我的 Android应用程序代码.
我使用project-> AndroID Tools->导出已签名的应用程序包选项与我的私有证书签名,签署完成后我收到了以下错误,

project.propertIEs

# This file is automatically generated by AndroID Tools.# Do not modify this file -- YOUR CHANGES WILL BE ERASED!## This file must be checked in Version Control Systems.## To customize propertIEs used by the Ant build system edit# "ant.propertIEs",and overrIDe values to adapt the script to your# project structure.## To enable ProGuard to shrink and obfuscate your code,uncomment this (available propertIEs: sdk.dir,user.home):proguard.config=${sdk.dir}/tools/proguard/proguard-androID.txt:proguard-project.txt# Project target.target=androID-17androID.library.reference.1=../Google-play-services_lib

ProGuard的-project.txt

# To enable ProGuard in your project,edit project.propertIEs# to define the proguard.config property as described in that file.## Add project specific ProGuard rules here.# By default,the flags in this file are appended to flags specifIEd# in ${sdk.dir}/tools/proguard/proguard-androID.txt# You can edit the include path and order by changing the ProGuard# include property in project.propertIEs.## For more details,see#   http://developer.androID.com/guIDe/develoPing/tools/proguard.HTML# Add any project specific keep options here:# If your project uses WebVIEw with Js,uncomment the following# and specify the fully qualifIEd class name to the JavaScript interface# class:#-keepclassmembers class fqcn.of.JavaScript.interface.for.webvIEw {#   public *;#}

控制台日志:

[2013-04-12 10:41:53 - MyApp] Proguard returned with error code 1. See console[2013-04-12 10:41:53 - MyApp] proguard.ParseException: Expecting class member name before '@' in line 82 of file '/Users/MyOrg/AndroID_workspace/MyApp/bin/proguard.txt',[2013-04-12 10:41:53 - MyApp]   included from argument number 6[2013-04-12 10:41:53 - MyApp]   at proguard.ConfigurationParser.readNextWord(ConfigurationParser.java:1133)[2013-04-12 10:41:53 - MyApp]   at proguard.ConfigurationParser.readNextWord(ConfigurationParser.java:1117)[2013-04-12 10:41:53 - MyApp]   at proguard.ConfigurationParser.parseMemberSpecificationArguments(ConfigurationParser.java:845)[2013-04-12 10:41:53 - MyApp]   at proguard.ConfigurationParser.parseClassspecificationArguments(ConfigurationParser.java:697)[2013-04-12 10:41:53 - MyApp]   at proguard.ConfigurationParser.parseKeepClassspecificationArguments(ConfigurationParser.java:490)[2013-04-12 10:41:53 - MyApp]   at proguard.ConfigurationParser.parse(ConfigurationParser.java:139)[2013-04-12 10:41:53 - MyApp]   at proguard.ProGuard.main(ProGuard.java:484)

>如何解决上述问题?
>在prouard.project文件中,我读了

If your project uses WebVIEw with Js,uncomment the following and
specify the fully qualifIEd class name to the JavaScript interface
class:

我在WebAppInterface.java类的两个活动中使用了webvIEw.如何做上面的语句?

@H_404_40@解决方法 引用资源名称如“@ string / on_click_handler_name”,在androID:onClick属性的布局文件中是可以的.但是,proguard无法解析这些引用.

检查http://android.okhelp.cz/proguard-parseexception-expecting-class-member-name-before/以获取更多详细信息.

在string.xml中找到@ string / tha_lf_et_todate_onclick的相应值并更新:

androID:onClick="@string/tha_lf_et_todate_onclick"

androID:onClick="onClickXXX"

在你的布局文件中.对于第二个问题,取消注释该段代码,并替换“fqcn.of.JavaScript.interface.for.webvIEw”使用班级的完全限定名称.

总结

以上是内存溢出为你收集整理的proguard.ParseException:在Android Eclipse ADT中期望’@’之前的类成员名称全部内容,希望文章能够帮你解决proguard.ParseException:在Android Eclipse ADT中期望’@’之前的类成员名称所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1128850.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存