我在生成启用 Pro-Guard 的签名 APK 时遇到了一个奇怪的问题。我正在显示一个列表视图,其中包含来自服务器的一些项目,文本颜色为黑色。在调试版本中,列表视图显示的数据没有任何问题。但是在发布模式下,列表视图显示具有透明颜色的数据,我使用黑色的文本颜色并在列表视图适配器类中设置颜色,因为在发布模式下,我可以单击列表视图并选择列表项,但列表中的项目视图不可见。
上图处于调试模式并正确显示列表视图。
上图处于发布模式。
请注意我的 Pro-Guard 文件
-keep class in.apricotz.outlet.ui.adapter.ListBaseAdapter.**
-keep class butterknife.** { *; }
-dontwarn butterknife.internal.**
-keep class **$$ViewBinder { *; }
-keepclasseswithmembernames class * {
@butterknife.* <fields>;
}
-keepclasseswithmembernames class * {
@butterknife.* <methods>;
}
-dontwarn org.apache.http.**
-dontwarn okio.**
-dontwarn retrofit2.**
-keep class retrofit2.** { *; }
-keepattributes Signature
-keepattributes Exceptions
-keepattributes *Annotation*
-keepattributes RuntimeVisibleAnnotations
-keepattributes RuntimeInvisibleAnnotations
-keepattributes RuntimeVisibleParameterAnnotations
-keepattributes RuntimeInvisibleParameterAnnotations
-keepattributes EnclosingMethod
-keepclasseswithmembers class * {
@retrofit2.* <methods>;
}
-keepclasseswithmembers interface * {
@retrofit2.* <methods>;
}
-keepattributes Signature
-keepnames class org.apache.** {*;}
-keep public class org.apache.** {*;}
-keep public class org.apache.http.**{*;}
-keep class rx.schedulers.Schedulers {
public static <methods>;
}
-keep class rx.schedulers.ImmediateScheduler {
public <methods>;
}
-keep class rx.schedulers.TestScheduler {
public <methods>;
}
-keep class rx.schedulers.Schedulers {
public static ** test();
}
-keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* {
long producerIndex;
long consumerIndex;
}
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef { long producerNode;
long consumerNode;
}
-dontwarn rx.internal.util.**
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-ignorewarnings
-repackageclasses ''
-allowaccessmodification
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-dontwarn android.support.design.**
-keep class android.support.design.** { *; }
-keep interface android.support.design.** { *; }
-keep public class android.support.design.R$* { *; }
-keep public class * extends android.support.v4.app.Fragment
-keepclassmembers class **.R$* {
public static <fields>;
}
这两天我一直在纠结这个问题。在调试版本中,该应用程序运行良好,没有任何问题。请帮我。
块引用