3

在我的项目中添加一个 Android 证书后,Codename One 服务器开始构建问题,然后通过询问 Codename One 支持,他们告诉我这可能与 Proguard 有关,所以在通过设置禁用 Proguard 后android.enableProguard=false不推荐正确的?因此,在这样做之后,Codename One 服务器构建良好,但我想保持 Proguard 启用,因为它是推荐的,但是当我保持启用 Codename One 服务器时,会出现以下错误日志的构建错误:https://s3.amazonaws .com/codenameone-build-response/d5f3c0c7-71a3-4a17-9f19-1c4e8fb3903d-1523988845519-error.txt

此外,我使用的唯一库是 cn1-codescan.cn1libCN1JSON.cn1libparse4cn1.cn1lib

我是否缺少 Proguard 构建提示?我正在使用以下 Proguard 构建提示:

android.proguardKeep=-keep class com.mypackage.ProblemClass { *; } -keep class android.support.v4.** { *; } -keep class android.support.v7.** { *; } -keep public class * extends android.app.Service -keep public class * extends android.content.BroadcastReceiver -keep public class * extends android.app.Activity -keep public class * extends android.preference.Preference -keep public class com.freshdesk.mobihelp.exception.MobihelpComponentNotFoundException -keepclassmembers class * implements android.os.Parcelable {   public static final android.os.Parcelable$Creator *; }
4

1 回答 1

2

您需要将单词替换ProblemClass为导致问题的类的完整路径...

你写了这个:

android.proguardKeep=-keep class com.mypackage.ProblemClass { *; } -keep class android.support.v4.** { *; } -keep class android.support.v7.** { *; } -keep public class * extends android.app.Service -keep public class * extends android.content.BroadcastReceiver -keep public class * extends android.app.Activity -keep public class * extends android.preference.Preference -keep public class com.freshdesk.mobihelp.exception.MobihelpComponentNotFoundException -keepclassmembers class * implements android.os.Parcelable {   public static final android.os.Parcelable$Creator *; }

你应该写这个com.parse.ParseOkHttpClient

android.proguardKeep=-keep class com.parse.ParseOkHttpClient { *; } -keep class android.support.v4.** { *; } -keep class android.support.v7.** { *; } -keep public class * extends android.app.Service -keep public class * extends android.content.BroadcastReceiver -keep public class * extends android.app.Activity -keep public class * extends android.preference.Preference -keep public class com.freshdesk.mobihelp.exception.MobihelpComponentNotFoundException -keepclassmembers class * implements android.os.Parcelable {   public static final android.os.Parcelable$Creator *; }
于 2018-04-18T04:28:09.867 回答