Android 设置MinifyEnabled-Kotlin后,应用程序崩溃,出现未知错误

Android 设置MinifyEnabled-Kotlin后,应用程序崩溃,出现未知错误,android,kotlin,proguard,minify,Android,Kotlin,Proguard,Minify,在我的应用程序完成后,当minify启用时,它会在第一个屏幕上不断崩溃。这些错误似乎与编写的代码无关,在互联网上也找不到,如果不问这个问题就可以解决问题 请检查下面提供的日志和proguard配置,并指出任何可能的解决方案 错误日志(我缩短了日志的重复部分): 前进规则: # Uncomment this to preserve the line number information for # debugging stack traces. -keepattributes SourceFile

在我的应用程序完成后,当minify启用时,它会在第一个屏幕上不断崩溃。这些错误似乎与编写的代码无关,在互联网上也找不到,如果不问这个问题就可以解决问题

请检查下面提供的日志和proguard配置,并指出任何可能的解决方案

错误日志(我缩短了日志的重复部分):

前进规则:

# Uncomment this to preserve the line number information for
# debugging stack traces.
-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

-keep class com.x.x.models.ClassModel
-keep class com.x.x.utils.Common
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep class * extends com.bumptech.glide.module.AppGlideModule {
 <init>(...);
}
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
  **[] $VALUES;
  public *;
}
-keep class com.bumptech.glide.load.data.ParcelFileDescriptorRewinder$InternalRewinder {
  *** rewind();
}

#-keep class android.graphics.drawable.ColorDrawable

-keep @androidx.annotation.Keep public class *

-dontwarn okio.**
-dontwarn retrofit2.**
-keep class retrofit2.* { *; }
-keepattributes Signature
-keepattributes Exceptions
-keepclassmembers class rx.internal.util.unsafe.* {
    long producerIndex;
    long consumerIndex;
}

-keepclasseswithmembers class * {
    @retrofit2.http.* <methods>;
}
-keep class com.google.gson.* { *; }
-keep class com.google.inject.* { *; }

# Render Script
#noinspection ShrinkerUnresolvedReference
-keepclasseswithmembernames class * {
native <methods>;
}
-keep class android.support.v8.renderscript.** { *; }
-keep class androidx.renderscript.** { *; }

-keep class com.zipow.* { *; }
-keep class com.zipow.cmmlib.AppUtil
#取消对此的注释以保留行号信息
#调试堆栈跟踪。
-keepattributes源文件,LineNumberTable
#如果保留行号信息,请将其取消注释为
#隐藏原始源文件名。
#-重命名SourceFileAttribute源文件
-保持类com.x.x.models.ClassModel
-保持类com.x.x.utils.Common
-keep public类*实现com.bumptech.glide.module.GlideModule
-keep class*扩展com.bumptech.glide.module.AppGlideModule{
(...);
}
-保持公共枚举com.bumptech.glide.load.ImageHeaderParser$**{
**[]美元价值;
公众*;
}
-保持类com.bumptech.glide.load.data.ParcelFileDescriptorRevender$InternalRevender{
***倒带();
}
#-保持类android.graphics.drawable.ColorDrawable
-keep@androidx.annotation.keep public class*
-唐特沃恩·奥基奥**
-dontwarn 2**
-保持类2.*{*;}
-保留署名
-保留特例
-keepclassmembers类rx.internal.util.unsafe.*{
长生产指数;
长消费指数;
}
-keepclassswithmembers类*{
@2.http.*;
}
-保持类com.google.gson.*{*;}
-保持类com.google.inject.*{*;}
#渲染脚本
#无检查收缩RunResolvedReference
-KeepClassSwithMemberNames类*{
本地人;
}
-保留类android.support.v8.renderscript.*{*;}
-保持类androidx.renderscript.*{*;}
-保持类com.zipow.*{*;}
-保持类com.zipow.cmmlib.AppUtil
除此之外,没有错误。我在规则中遗漏了什么吗


编辑:我检查了一遍又一遍,仍然没有发现任何错误。该应用程序在没有启用Minify的情况下运行良好。

在这里没有得到任何响应后,我联系了一位我认识的资深同事,并想出了一个解决方案

如果我能在logcat中看到它,我本可以修复它的,这就是我问这个问题的原因。因此,解决方案是,我应该在终端中查看ADB提供的logcat,而不是查看Android Studio提供的logcat。我在Android studio的logcat中没有使用任何过滤器或关键字,只是没有显示任何内容


因此,我运行了一个命令
adb logcat | findstr“app_name”
,由于proguard,我能够在Zoom SDK中看到这个问题
findstr“app_name”
在这里是可选的,可以按app name过滤日志,因为日志很大,很难用
adb logcat进行过滤

这真是太酷了。你救了我一天,我花了3天的时间来查找问题的来源,然后我找到了你:)。谢谢你。@Memo我很高兴能帮上忙,兄弟。当我问我认识的人时,我甚至被困了三天。您还可以通过在命令末尾添加
>filename.txt
导出此日志,以便在记事本中轻松查找。
# Uncomment this to preserve the line number information for
# debugging stack traces.
-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

-keep class com.x.x.models.ClassModel
-keep class com.x.x.utils.Common
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep class * extends com.bumptech.glide.module.AppGlideModule {
 <init>(...);
}
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
  **[] $VALUES;
  public *;
}
-keep class com.bumptech.glide.load.data.ParcelFileDescriptorRewinder$InternalRewinder {
  *** rewind();
}

#-keep class android.graphics.drawable.ColorDrawable

-keep @androidx.annotation.Keep public class *

-dontwarn okio.**
-dontwarn retrofit2.**
-keep class retrofit2.* { *; }
-keepattributes Signature
-keepattributes Exceptions
-keepclassmembers class rx.internal.util.unsafe.* {
    long producerIndex;
    long consumerIndex;
}

-keepclasseswithmembers class * {
    @retrofit2.http.* <methods>;
}
-keep class com.google.gson.* { *; }
-keep class com.google.inject.* { *; }

# Render Script
#noinspection ShrinkerUnresolvedReference
-keepclasseswithmembernames class * {
native <methods>;
}
-keep class android.support.v8.renderscript.** { *; }
-keep class androidx.renderscript.** { *; }

-keep class com.zipow.* { *; }
-keep class com.zipow.cmmlib.AppUtil