Proguard的错误code 1:Proguard.ParseException [英] Proguard Error Code 1: Proguard.ParseException

查看:1789
本文介绍了Proguard的错误code 1:Proguard.ParseException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我的Andr​​oid应用程序导出并启用ProGuard的,当我得到这个错误: -

I am trying to export my android application with proguard enabled when I get this error:-

 Proguard returned with error code 1. See console
 proguard.ParseException: Expecting java type before ' ' in line 79 of file 'C:\Documents and Settings\Acer.ACER-2487AA0235\My Documents\Eclipse\Myproject\proguard-project.txt',
included from argument number 4
at proguard.ConfigurationParser.checkJavaIdentifier(ConfigurationParser.java:1187)
at proguard.ConfigurationParser.parseMemberSpecificationArguments(ConfigurationParser.java:842)
at proguard.ConfigurationParser.parseClassSpecificationArguments(ConfigurationParser.java:697)
at proguard.ConfigurationParser.parseKeepClassSpecificationArguments(ConfigurationParser.java:490)
at proguard.ConfigurationParser.parse(ConfigurationParser.java:139)
at proguard.ProGuard.main(ProGuard.java:484)

从ProGuard的-project.txt线77-80: -

-keepclassmembers class * 
{ 
 @android.webkit.JavascriptInterface <methods>;
}

完整ProGuard的项目: -

-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-keepattributes *Annotation*

-injars      bin/classes
-injars      libs
-outjars     bin/classes-processed.jar

-libraryjars /libs/com-rfhtaej-vskwgkw207826.jar


-keep public class * extends android.app.Activity 
-keep public class * extends android.app.Application 
-keep public class * extends android.app.Service 
-keep public class * extends android.content.BroadcastReceiver 
-keep public class * extends android.content.ContentProvider  
-keep public class * extends android.preference.Preference
-keep class com.rfhtaej.vskwgkw207826.** {*;}
-dontwarn com.rfhtaej.vskwgkw207826.**



-keepclasseswithmembernames class * 
 {
    native <methods>;
 }

 -keepclasseswithmembers class * 
  {
    public <init>(android.content.Context, android.util.AttributeSet);
  }

 -keepclasseswithmembers class * 
  {
    public <init>(android.content.Context, android.util.AttributeSet, int);
  }

  -keepclassmembers enum * 
  {
    public static **[] values();
    public static ** valueOf(java.lang.String);
  }



  -keep class * implements android.os.Parcelable 
   {
     public static final android.os.Parcelable$Creator *;
   }

   -keepclasseswithmembers class **.R$** 
   {
    public static <fields>;
   }

  -keepclassmembers class * 
  {
    @android.webkit.JavascriptInterface<methods>;
  }
   -keep class * extends android.view.View 
    { 

      public <init>(android.content.Context); 
      public <init>(android.content.Context, android.util.AttributeSet); 
      public <init>(android.content.Context, android.util.AttributeSet, int); 
      void set*(***);
       *** get*();
    }

   -keepclassmembers class * 
    {
        static final %                *;
        static final java.lang.String *;
    }

-keep class * extends java.util.ListResourceBundle {
    protected Object[][] getContents();
}

-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
    public static final *** NULL;
}

-keepnames @com.google.android.gms.common.annotation.KeepName class *
-keepclassmembernames class * {
    @com.google.android.gms.common.annotation.KeepName *;
}

-keepnames class * implements android.os.Parcelable {
    public static final ** CREATOR;
}

-dontwarn com.google.android.gms.**


-keepattributes SetJavaScriptEnabled
-keepattributes JavascriptInterface
-keepattributes InlinedApi

如何解决这个问题,我的应用程序的任何想法都是完整的,它吮吸,我无法将它发布由于在最后阶段的错误。谢谢。

Any Ideas on how to solve this problem as my application is all complete and it sucks that I am unable to publish it because of an error at the last stage. Thank You.

推荐答案

我遇到了同样的错误,最后整理出来通过保持在ProGuard的-project.txt文件下面的行

I faced the same error and finally sorted it out by keeping the below line in the proguard-project.txt file

-libraryjars /libs/Your_Jar_File.jar

-libraryjars /libs/Your_Jar_File.jar

就排除你觉得它永远哪个jar文件导致你厚望。

Just exclude jar file which ever you feel it is causing you the expection.

我现在面临这个问题是由于一个外部jar文件。凡ProGuard的混淆它。正如在我的情况airpush jar文件创建的问题。只是排除它。

I am facing this issue due to one external jar file. Where proguard is obfuscating it. As in my case airpush jar file is creating the problem. Just exclude it.

这篇关于Proguard的错误code 1:Proguard.ParseException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆