gpt4 book ai didi

android - Proguard 错误代码 1 : Proguard. ParseException

转载 作者:行者123 更新时间:2023-11-30 02:32:52 25 4
gpt4 key购买 nike

当我收到此错误时,我正在尝试导出启用了 proguard 的 android 应用程序:-

 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-project:-

-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

关于如何解决这个问题的任何想法,因为我的应用程序已经完成,但由于最后阶段的错误我无法发布它很糟糕。谢谢。

最佳答案

我遇到了同样的错误,最后通过在 proguard-project.txt 文件中保留以下行来解决问题

-libraryjars/libs/Your_Jar_File.jar

只需排除您认为引起您期望的 jar 文件即可。

由于一个外部 jar 文件,我遇到了这个问题。 Proguard 混淆它的地方。就我而言,airpush jar 文件造成了问题。只是排除它。

关于android - Proguard 错误代码 1 : Proguard. ParseException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27074801/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com