我的应用程序完成后,当启用minify时,它会在第一个屏幕上不断崩溃。这些错误似乎与编写的代码无关,在互联网上也找不到,而互联网本可以在不问这个问题的情况下解决问题。
请检查下面提供的日志和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
除此之外没有任何错误。我是不是遗漏了一些规则?
编辑:我检查了一遍又一遍,仍然没有发现任何错误。该应用程序在没有迷你功能的情况下运行良好。
在这里没有得到回应后,我联系了我认识的一位资深同事,找到了一个解决方案。
如果我能在logcat中看到它,我本可以修复它,这就是我问这个问题的原因。因此,解决方案是,我应该在终端中查看ADB提供的logcat,而不是查看Android Studio提供的logcat。我在安卓工作室的logcat中没有使用过滤器或关键字,只是没有显示任何内容。
因此,我运行了一个命令adb logcat | findstr "app_name"
,由于proguard,我能够在Zoom SDK中看到这个问题。findstr "app_name"
在这里是可选的,可以按应用程序名称过滤日志,因为日志很大,很难用adb logcat
过滤。