导出应用程序时android中的Proguard错误?

时间:2013-04-25 12:00:08

标签: android proguard

我开发的android应用程序所有功能都运行正常。但是当我尝试导出应用程序时,我收到以下错误

Proguard带着error code 1返回。见控制台

我的控制台在这里

 proguard.ParseException: Expecting class member name before '@' in line 162 of file 'D:\Android\Workspace.gopal\LoginActivity\bin\proguard.txt',
    LoginActivity]   included from argument number 6
    LoginActivity]  at proguard.ConfigurationParser.readNextWord(ConfigurationParser.java:1133)
    LoginActivity]  at     proguard.ConfigurationParser.readNextWord(ConfigurationParser.java:1117)
    LoginActivity]  at proguard.ConfigurationParser.parseMemberSpecificationArguments(ConfigurationParser.java:845)
    LoginActivity]  at proguard.ConfigurationParser.parseClassSpecificationArguments(ConfigurationParser.java:697)
    LoginActivity]  at proguard.ConfigurationParser.parseKeepClassSpecificationArguments(ConfigurationParser.java:490)
    LoginActivity]  at proguard.ConfigurationParser.parse(ConfigurationParser.java:139)
    LoginActivity]  at proguard.ProGuard.main(ProGuard.java:484)

在此处添加了proguard设置

      view res/layout/my_eg.xml  generated:97
-keep class android.support.v4.view.ViewPager { <init>(...); }

  view AndroidManifest.xml  generated:96
-keep class com.eg.mobile.AboutUsActivity { <init>(...); }

  view AndroidManifest.xml  generated:74
-keep class com.eg.mobile.AddHighlightActivity { <init>(...); }

  view AndroidManifest.xml  generated:70
-keep class com.eg.mobile.AlbumCreationActivity { <init>(...); }

  view AndroidManifest.xml  generated:171
-keep class com.eg.mobile.CameraActivity { <init>(...); }

  view AndroidManifest.xml  generated:156
-keep class com.eg.mobile.CameraFlowActivity { <init>(...); }

  view AndroidManifest.xml  generated:160
-keep class com.eg.mobile.CameraHomeScreenActivity { <init>(...); }

  view AndroidManifest.xml  generated:164
-keep class com.eg.mobile.CameraPreviewActivity { <init>(...); }

  view AndroidManifest.xml  generated:181
-keep class com.eg.mobile.ChooseHomescreenActivity { <init>(...); }

  view AndroidManifest.xml  generated:92
-keep class com.eg.mobile.ContactUsActivity { <init>(...); }

  view AndroidManifest.xml  generated:66
-keep class com.eg.mobile.CreateActivity { <init>(...); }

  view AndroidManifest.xml  generated:194
-keep class com.eg.mobile.EGBlogActivity { <init>(...); }

  view AndroidManifest.xml  generated:198
-keep class com.eg.mobile.EGBlogDetailsActivity { <init>(...); }

  view AndroidManifest.xml  generated:190
-keep class com.eg.mobile.FAQActivity { <init>(...); }

  view AndroidManifest.xml  generated:147
-keep class com.eg.mobile.FanMemberDetailsActivity { <init>(...); }

  view AndroidManifest.xml  generated:46
-keep class com.eg.mobile.GCMIntentService { <init>(...); }

  view AndroidManifest.xml  generated:58
-keep class com.eg.mobile.LandingActivity { <init>(...); }

  view AndroidManifest.xml  generated:133
-keep class com.eg.mobile.LightboxActivity { <init>(...); }

  view AndroidManifest.xml  generated:34
-keep class com.eg.mobile.LoginActivity { <init>(...); }

  view AndroidManifest.xml  generated:207
-keep class com.eg.mobile.MessageConversation { <init>(...); }

  view AndroidManifest.xml  generated:213
-keep class com.eg.mobile.MultiPhotoSelectActivity { <init>(...); }

  view AndroidManifest.xml  generated:139
-keep class com.eg.mobile.MyEgActivity { <init>(...); }

  view AndroidManifest.xml  generated:119
-keep class com.eg.mobile.MyEgDetailsActivity { <init>(...); }

  view AndroidManifest.xml  generated:124
-keep class com.eg.mobile.MyEgLibraryActivity { <init>(...); }

  view AndroidManifest.xml  generated:114
-keep class com.eg.mobile.MyEgLibraryContentActivity { <init>(...); }

  view AndroidManifest.xml  generated:151
-keep class com.eg.mobile.MyEgMessagingActivity { <init>(...); }

  view AndroidManifest.xml  generated:185
-keep class com.eg.mobile.MyEgNotificationsActivity { <init>(...); }

  view AndroidManifest.xml  generated:143
-keep class com.eg.mobile.MyfanbaseActivity { <init>(...); }

  view AndroidManifest.xml  generated:219
-keep class com.eg.mobile.NotificationSettings { <init>(...); }

  view AndroidManifest.xml  generated:104
-keep class com.eg.mobile.OurCommunityActivity { <init>(...); }

  view AndroidManifest.xml  generated:100
-keep class com.eg.mobile.OurStoryActivity { <init>(...); }

  view AndroidManifest.xml  generated:135
-keep class com.eg.mobile.PostCommentsActivity { <init>(...); }

  view AndroidManifest.xml  generated:108
-keep class com.eg.mobile.PostCreationActivity { <init>(...); }

  view AndroidManifest.xml  generated:88
-keep class com.eg.mobile.PrivacyActivity { <init>(...); }

  view AndroidManifest.xml  generated:78
-keep class com.eg.mobile.RegistrationActivity { <init>(...); }

  view AndroidManifest.xml  generated:128
-keep class com.eg.mobile.SearchActivity { <init>(...); }

  view AndroidManifest.xml  generated:62
-keep class com.eg.mobile.ThankYouActivity { <init>(...); }

  view AndroidManifest.xml  generated:84
-keep class com.eg.mobile.TosActivity { <init>(...); }

  view AndroidManifest.xml  generated:176
-keep class com.eg.mobile.UpdateProfileActivity { <init>(...); }

  view AndroidManifest.xml  generated:168
-keep class com.eg.mobile.UploadActivity { <init>(...); }

  view AndroidManifest.xml  generated:202
-keep class com.eg.mobile.VideoPlayerActivity { <init>(...); }

  view AndroidManifest.xml  generated:29
-keep class com.eg.mobile.common.EGApplication { <init>(...); }

  view res/layout/myeg_message_conversation.xml  generated:83
  view res/layout/myeg_messaging.xml  generated:100
-keep class com.eg.mobile.common.EditTextBackEvent { <init>(...); }

  view res/layout/eg_library_list_item.xml  generated:22
-keep class com.eg.mobile.common.ExpandedGridView { <init>(...); }

  view res/layout/eg_blog_highlights.xml  generated:177
  view res/layout/egblog_landingpage.xml  generated:174
  view res/layout/myeg_notifications.xml  generated:37
-keep class com.eg.mobile.pulltorefreshlist.PullToRefreshView { <init>(...); }

  view res/layout/myeg_messages.xml  generated:122
  view res/layout/myeg_messaging.xml  generated:137
-keep class com.eg.mobile.srg.SrgEgMessage { <init>(...); }

  view res/layout/my_eg_library.xml  generated:39
  view res/layout/myeg_library_mycontent.xml  generated:191
-keep class com.eg.mobile.srg.SrgMyEgLibrary { <init>(...); }

  view res/layout/fan_member_details.xml  generated:39
  view res/layout/my_eg.xml  generated:48
  view res/layout/myfanbase.xml  generated:40
-keep class com.eg.mobile.srg.SrgMyEgTabs { <init>(...); }

  view res/layout/myeg_search.xml  generated:79
  view res/layout/search.xml  generated:111
-keep class com.eg.mobile.srg.SrgSearch { <init>(...); }

  view AndroidManifest.xml  generated:48
-keep class com.google.android.gcm.GCMBroadcastReceiver { <init>(...); }

  onClick res/layout/fanofpopup.xml  generated:28
  onClick res/layout/fanofpopup.xml  generated:41
  onClick res/layout/myeg_detail_view.xml  generated:75
-keepclassmembers class * { *** @drawable/gradient_active_button(...); }

  onClick res/layout/ac_image_grid.xml  generated:18
-keepclassmembers class * { *** btnChoosePhotosClick(...); }

  onClick res/layout/myeg_search_results.xml  generated:46
  onClick res/layout/search.xml  generated:68
-keepclassmembers class * { *** searchClick(...); }

请任何人帮助我

2 个答案:

答案 0 :(得分:1)

如果您的proguard.txt显示:

-keepclassmembers class * { *** @drawable/gradient_activ_button(...); }

或:

-keepclassmembers class * { *** @string/onClickXXX(...); }

检查您的布局文件,并替换:

android:onClick="@string/onClickXXX"

android:onClick="real Name of onClickEvent Handler"

直接引用事件处理程序的名称。 Proguard无法解析资源名称。

答案 1 :(得分:0)

错误

Expecting class member name before '@' in line 162 of file 'D:\Android\Workspace.gopal\LoginActivity\bin\proguard.txt'

表示在自动生成的文件bin / proguard.txt的第162行出错。您可能想要检查您的SDK版本是否是最新的。