gpt4 book ai didi

java - proguard 解析 android.txt 文件中的异常

转载 作者:行者123 更新时间:2023-12-02 06:18:33 26 4
gpt4 key购买 nike

我遇到了这个异常。

proguard.ParseException: Expecting opening '(' or separator ';' before '=' in line 48 of file 'D:\adt-bundle-windows-x86_64-20130717\adt-bundle-windows-x86_64-20130717\sdk\tools\proguard\proguard-android.txt', 

第 47 -56 行在下面

-keepclassmembers class com.sec.svoice.api.SVoice {
private java.lang.long interface_handle = -1L;
private java.lang.long sentinel_handle = -1L;
private java.lang.String host;
private java.lang.int port;
private java.lang.String deviceId;
public static final java.lang.int SP_ASR = 1;
public static final java.lang.int SP_NLU = 2;
static final java.lang.int[] seed;
}

最佳答案

假设这些字段中的大多数实际上是原语,正确的语法是:

-keepclassmembers class com.sec.svoice.api.SVoice {
private long interface_handle;
private long sentinel_handle;
private java.lang.String host;
private int port;
private java.lang.String deviceId;
public static final int SP_ASR;
public static final int SP_NLU;
static final int[] seed;
}

如果您愿意,您可以省略修饰符:

-keepclassmembers class com.sec.svoice.api.SVoice {
long interface_handle;
long sentinel_handle;
java.lang.String host;
int port;
java.lang.String deviceId;
int SP_ASR;
int SP_NLU;
int[] seed;
}

如果这些是所有字段,您可以使用通配符:

-keepclassmembers class com.sec.svoice.api.SVoice {
<fields>;
}

如果您出于序列化目的保留字段,则可能只需要非静态字段:

-keepclassmembers class com.sec.svoice.api.SVoice {
!static <fields>;
}

关于java - proguard 解析 android.txt 文件中的异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21236149/

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