设置 MinifyEnabled 后应用程序崩溃并出现未知错误 - Kotlin
App crashes with unknown errors after setting MinifyEnabled - Kotlin
我的应用程序完成后,当启用缩小时,它总是在第一个屏幕上崩溃。这些错误似乎与编写的代码无关,并且在互联网上找不到任何地方可以在不问这个问题的情况下解决问题。
请检查下面提供的日志和 proguard 配置,并尽可能指出任何解决方案。
错误日志(我把日志的重复部分剪短了):
31322-31322/com.x.x E/libEGL: Invalid file path for libcolorx-loader.so
31322-31322/com.x.x E/libEGL: Invalid file path for libcolorx-loader.so
31322-31541/com.x.x E/RenderScript: Failed loading RS driver: dlopen failed: library "libRSDriver_mtk.so" not found
31322-31541/com.x.x E/RenderScript: Failed to load runtime libRSDriver_mtk.so, loading default
//Repetition of the below block about 30 times
1391-1391/com.x.x W/com.x.x: Accessing hidden field Landroid/renderscript/RenderScriptCacheDir;->mCacheDir:Ljava/io/File; (greylist, JNI, allowed)
1391-1391/com.x.x D/com.x.x: Successfully queried cache dir: /data/user_de/0/com.x.x/code_cache
1391-1391/com.x.x D/RenderScript: Setting cache dir: /data/user_de/0/com.x.x/code_cache
1391-1879/com.x.x D/skia: --- Failed to create image decoder with message 'unimplemented'
1391-1879/com.x.x D/DRM/DcfDecoder: decodeDrmImageIfNeeded: header = [B@531c48e
1391-1879/com.x.x D/DRM/DcfDecoder: decodeDrmImageIfNeeded: [0][0][0][0][0]
1391-1879/com.x.x D/DRM/DcfDecoder: decodeDrmImageIfNeeded: headerSize = 0
1391-1879/com.x.x D/DRM/DcfDecoder: decodeDrmImageIfNeeded: after header = [B@3e824af
1391-1879/com.x.x D/DRM_DCF_DECODER_JNI: nativeDecryptDcfFile: size = 2548, action = 1
1391-1879/com.x.x D/DRM_DCF_DECODER_JNI: nativeDecryptDcfFile: openDecryptSession with offset = 0
1391-1879/com.x.x E/DRM_DCF_DECODER_JNI: nativeDecryptDcfFile: failed to openDecryptSession, trigger showDrmDialogIfNeed
1391-1879/com.x.x E/DRM/DcfDecoder: decodeDrmImage native decrypt failed
1391-1879/com.x.x D/skia: --- Failed to create image decoder with message 'unimplemented'
1391-1879/com.x.x D/DRM/DcfDecoder: decodeDrmImageIfNeeded: header = [B@531c48e
1391-1879/com.x.x D/DRM/DcfDecoder: decodeDrmImageIfNeeded: [0][0][0][0][0]
1391-1879/com.x.x D/DRM/DcfDecoder: decodeDrmImageIfNeeded: headerSize = 0
1391-1879/com.x.x D/DRM/DcfDecoder: decodeDrmImageIfNeeded: after header = [B@6c643c1
1391-1879/com.x.x D/DRM_DCF_DECODER_JNI: nativeDecryptDcfFile: size = 2548, action = 0
1391-1879/com.x.x D/DRM_DCF_DECODER_JNI: nativeDecryptDcfFile: openDecryptSession with offset = 0
31322-31440/com.x.x E/DRM/DcfDecoder: decodeDrmImage native decrypt failed
//Repetition of the above block about 30 times
31322-31440/com.x.x E/DRM_DCF_DECODER_JNI: nativeDecryptDcfFile: failed to openDecryptSession, trigger showDrmDialogIfNeed
1443-1852/? E/InputDispatcher: channel 'c05756c com.x.x/com.x.x.activity.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
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
除此之外没有错误。我是不是漏掉了一些规则?
编辑:我检查了一遍又一遍,仍然没有发现任何错误。该应用程序在没有启用 minify 的情况下运行良好。
在这里没有得到回应后,我联系了一位我认识的资深人士并想出了一个解决方案。
如果我能在 logcat 中看到它,我就可以修复它,这就是我问这个问题的原因。因此,解决方案是,与其查看 Android Studio 提供的 logcat,我应该查看 ADB 在终端中提供的 logcat。我在 Android 工作室的 logcat 中没有使用过滤器或关键字,它只是没有显示任何内容。
所以,我 运行 命令 adb logcat | findstr "app_name"
并且由于混淆器,我能够在 Zoom SDK 中看到问题。 findstr "app_name"
在这里是可选的,可以按应用程序名称过滤日志,因为日志很大,很难用 adb logcat
过滤。
我的应用程序完成后,当启用缩小时,它总是在第一个屏幕上崩溃。这些错误似乎与编写的代码无关,并且在互联网上找不到任何地方可以在不问这个问题的情况下解决问题。
请检查下面提供的日志和 proguard 配置,并尽可能指出任何解决方案。
错误日志(我把日志的重复部分剪短了):
31322-31322/com.x.x E/libEGL: Invalid file path for libcolorx-loader.so
31322-31322/com.x.x E/libEGL: Invalid file path for libcolorx-loader.so
31322-31541/com.x.x E/RenderScript: Failed loading RS driver: dlopen failed: library "libRSDriver_mtk.so" not found
31322-31541/com.x.x E/RenderScript: Failed to load runtime libRSDriver_mtk.so, loading default
//Repetition of the below block about 30 times
1391-1391/com.x.x W/com.x.x: Accessing hidden field Landroid/renderscript/RenderScriptCacheDir;->mCacheDir:Ljava/io/File; (greylist, JNI, allowed)
1391-1391/com.x.x D/com.x.x: Successfully queried cache dir: /data/user_de/0/com.x.x/code_cache
1391-1391/com.x.x D/RenderScript: Setting cache dir: /data/user_de/0/com.x.x/code_cache
1391-1879/com.x.x D/skia: --- Failed to create image decoder with message 'unimplemented'
1391-1879/com.x.x D/DRM/DcfDecoder: decodeDrmImageIfNeeded: header = [B@531c48e
1391-1879/com.x.x D/DRM/DcfDecoder: decodeDrmImageIfNeeded: [0][0][0][0][0]
1391-1879/com.x.x D/DRM/DcfDecoder: decodeDrmImageIfNeeded: headerSize = 0
1391-1879/com.x.x D/DRM/DcfDecoder: decodeDrmImageIfNeeded: after header = [B@3e824af
1391-1879/com.x.x D/DRM_DCF_DECODER_JNI: nativeDecryptDcfFile: size = 2548, action = 1
1391-1879/com.x.x D/DRM_DCF_DECODER_JNI: nativeDecryptDcfFile: openDecryptSession with offset = 0
1391-1879/com.x.x E/DRM_DCF_DECODER_JNI: nativeDecryptDcfFile: failed to openDecryptSession, trigger showDrmDialogIfNeed
1391-1879/com.x.x E/DRM/DcfDecoder: decodeDrmImage native decrypt failed
1391-1879/com.x.x D/skia: --- Failed to create image decoder with message 'unimplemented'
1391-1879/com.x.x D/DRM/DcfDecoder: decodeDrmImageIfNeeded: header = [B@531c48e
1391-1879/com.x.x D/DRM/DcfDecoder: decodeDrmImageIfNeeded: [0][0][0][0][0]
1391-1879/com.x.x D/DRM/DcfDecoder: decodeDrmImageIfNeeded: headerSize = 0
1391-1879/com.x.x D/DRM/DcfDecoder: decodeDrmImageIfNeeded: after header = [B@6c643c1
1391-1879/com.x.x D/DRM_DCF_DECODER_JNI: nativeDecryptDcfFile: size = 2548, action = 0
1391-1879/com.x.x D/DRM_DCF_DECODER_JNI: nativeDecryptDcfFile: openDecryptSession with offset = 0
31322-31440/com.x.x E/DRM/DcfDecoder: decodeDrmImage native decrypt failed
//Repetition of the above block about 30 times
31322-31440/com.x.x E/DRM_DCF_DECODER_JNI: nativeDecryptDcfFile: failed to openDecryptSession, trigger showDrmDialogIfNeed
1443-1852/? E/InputDispatcher: channel 'c05756c com.x.x/com.x.x.activity.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
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
除此之外没有错误。我是不是漏掉了一些规则?
编辑:我检查了一遍又一遍,仍然没有发现任何错误。该应用程序在没有启用 minify 的情况下运行良好。
在这里没有得到回应后,我联系了一位我认识的资深人士并想出了一个解决方案。
如果我能在 logcat 中看到它,我就可以修复它,这就是我问这个问题的原因。因此,解决方案是,与其查看 Android Studio 提供的 logcat,我应该查看 ADB 在终端中提供的 logcat。我在 Android 工作室的 logcat 中没有使用过滤器或关键字,它只是没有显示任何内容。
所以,我 运行 命令 adb logcat | findstr "app_name"
并且由于混淆器,我能够在 Zoom SDK 中看到问题。 findstr "app_name"
在这里是可选的,可以按应用程序名称过滤日志,因为日志很大,很难用 adb logcat
过滤。