gpt4 book ai didi

android - Proguard : can't find referenced method 'android. app.DatePickerDialog 访问$000

转载 作者:行者123 更新时间:2023-11-29 19:21:10 24 4
gpt4 key购买 nike

我在 Release模式下启用了 pro-guard,但在启动应用程序后出现此错误:

Warning:FormActivity$1: can't find referenced method 'android.app.DatePickerDialog access$000(FormActivity)' in program class FormActivity
Warning:FormActivity$2: can't find referenced method 'android.app.DatePickerDialog access$000(FormActivity)' in program class FormActivity
Warning:FormActivity$3: can't find referenced method 'android.app.TimePickerDialog access$100(FormActivity)' in program class FormActivity
Warning:FormActivity$4: can't find referenced method 'void access$200(FormActivity,int,android.widget.LinearLayout,boolean)' in program class FormActivity
Warning:FormActivity$4: can't find referenced method 'void access$300(FormActivity,int,android.widget.LinearLayout,boolean)' in program class FormActivity
Warning:FormActivity$5: can't find referenced method 'android.widget.LinearLayout access$400(FormActivity,int,java.lang.String,android.widget.LinearLayout)' in program class FormActivity
Warning:FormActivity$5: can't find referenced method 'void access$500(FormActivity,int,android.widget.LinearLayout,boolean,boolean[],int,int)' in program class FormActivity
Warning:FormActivity$5: can't find referenced method 'void access$600(FormActivity,int,android.widget.LinearLayout,boolean,boolean[],int,int)' in program class FormActivity
Warning:FormActivity$6: can't find referenced method 'void access$700(FormActivity,int,int)' in program class FormActivity
Warning:FormActivity$7: can't find referenced method 'boolean access$802(FormActivity,boolean)' in program class FormActivity
Warning:FormActivity$8: can't find referenced method 'boolean access$802(FormActivity,boolean)' in program class FormActivity

这是我的混淆文件:

-dontobfuscate
-dontoptimize
-optimizations !code/allocation/variable
#Start Project specifics

#Keep the BuildConfig
-keep class com.alouane.beapp.BuildConfig { *; }

#Keep the support library
-keep class android.support.v4.** { *; }
-keep interface android.support.v4.** { *; }

#Gson
-keepattributes Signature
-keepattributes *Annotation*
-keep class sun.misc.Unsafe { *; }
-keep class com.dubai.fa.model.** { *; }
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer

#Picasso
-dontwarn com.squareup.okhttp.**

# rx_cache
-dontwarn io.rx_cache2.internal.**
-keepclassmembers enum io.rx_cache2.Source { *; }
#RxJava
-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 {
rx.internal.util.atomic.LinkedQueueNode producerNode;
rx.internal.util.atomic.LinkedQueueNode consumerNode;
}

-keep class com.google.**
-dontwarn com.google.**
-dontwarn sun.misc.**

#Timber
-dontwarn org.jetbrains.annotations.**

-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontpreverify
-verbose

# standard

-keep public class * extends android.app.Activity
-keep public class * extends android.support.v7.app.ActionBarActivity
-keep public class * extends android.support.v4.app.Fragment
-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

-keepclasseswithmembers 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 *;
}

-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}

我使用的大多数库:Rxjava、Dagger .. 不需要添加 proguard 规则。

那么 .. 你知道如何解决这个问题吗,因为这是我第一次使用 prougard 进行发布构建。谢谢。

最佳答案

当我为我的项目启用 Java 8 功能时,我遇到了这个问题。调试构建运行良好,但签名的 apk 无法构建,出现 can't find ... access$100... 错误。
一个干净的项目让它再次工作。

在 Android Studio 中尝试 Project -> Clean Project - 它应该始终是第一个尝试的事情,因为它经常会修复问题。


虽然这是一个老问题,但它是我在搜索错误消息时遇到的第一个问题 - 所以我将此修复留在这里以供其他人访问。

关于android - Proguard : can't find referenced method 'android. app.DatePickerDialog 访问$000,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42440397/

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