gpt4 book ai didi

android - Android应用错误:未找到Kotlin类,但仅在Release apk上

转载 作者:行者123 更新时间:2023-12-02 13:17:38 25 4
gpt4 key购买 nike

我有一个非常奇怪的错误,仅在版本上发生。如果我通过Android Studio以 Debug模式安装该应用程序,则一切正常。如果我将bild变体更改为Release,则在应用程序启动时会得到此错误:

2020-06-02 20:53:14.892 19248-19248/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2020-06-02 20:53:14.892 19248-19248/? A/DEBUG: Build fingerprint: 'motorola/griffin/griffin:8.0.0/OPL27.76-71-2-3/3:user/release-keys'
2020-06-02 20:53:14.892 19248-19248/? A/DEBUG: Revision: 'p3b0'
2020-06-02 20:53:14.892 19248-19248/? A/DEBUG: ABI: 'arm64'
2020-06-02 20:53:14.892 19248-19248/? A/DEBUG: pid: 19179, tid: 19179, name: om.stompai.kick >>> com.stompai.kick <<<
2020-06-02 20:53:14.892 19248-19248/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
2020-06-02 20:53:14.893 19248-19248/? A/DEBUG: Abort message: 'thread.cc:2036] No pending exception expected: java.lang.ClassNotFoundException: Didn't find class "com.mobileer.androidfxlab.datatype.EffectDescription" on path: DexPathList[[zip file "/data/app/com.stompai.kick-2yS5YP_5sv5B-eZMR3oZbA==/base.apk"],nativeLibraryDirectories=[/data/app/com.stompai.kick-2yS5YP_5sv5B-eZMR3oZbA==/lib/arm64, /data/app/com.stompai.kick-2yS5YP_5sv5B-eZMR3oZbA==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]'
2020-06-02 20:53:14.893 19248-19248/? A/DEBUG: x0 0000000000000000 x1 0000000000004aeb x2 0000000000000006 x3 0000000000000008
2020-06-02 20:53:14.893 19248-19248/? A/DEBUG: x4 0000000000000000 x5 0000000000000000 x6 0000000000000000 x7 0080808080808080
2020-06-02 20:53:14.893 19248-19248/? A/DEBUG: x8 0000000000000083 x9 f6d5a51ab7c22c2d x10 0000000000000000 x11 0000000000000001
2020-06-02 20:53:14.893 19248-19248/? A/DEBUG: x12 ffffffffffffffff x13 0000000000000008 x14 ffffffffffffffff x15 000017b556277360
2020-06-02 20:53:14.893 19248-19248/? A/DEBUG: x16 0000007f881e12f8 x17 0000007f881829d4 x18 0000000000000020 x19 0000000000004aeb
2020-06-02 20:53:14.893 19248-19248/? A/DEBUG: x20 0000000000004aeb x21 0000007f77dc0800 x22 0000000000000058 x23 000000000000095c
2020-06-02 20:53:14.893 19248-19248/? A/DEBUG: x24 0000000000000061 x25 0000007f6c157600 x26 000000000000095b x27 0000000000000059
2020-06-02 20:53:14.893 19248-19248/? A/DEBUG: x28 0000007fd10538a1 x29 0000007fd10535a0 x30 0000007f88136d24
2020-06-02 20:53:14.893 19248-19248/? A/DEBUG: sp 0000007fd1053560 pc 0000007f881829dc pstate 0000000060000000
2020-06-02 20:53:14.898 19248-19248/? A/DEBUG: backtrace:
2020-06-02 20:53:14.898 19248-19248/? A/DEBUG: #00 pc 00000000000699dc /system/lib64/libc.so (tgkill+8)
2020-06-02 20:53:14.898 19248-19248/? A/DEBUG: #01 pc 000000000001dd20 /system/lib64/libc.so (abort+88)
2020-06-02 20:53:14.898 19248-19248/? A/DEBUG: #02 pc 0000000000437c9c /system/lib64/libart.so (_ZN3art7Runtime5AbortEPKc+528)
2020-06-02 20:53:14.898 19248-19248/? A/DEBUG: #03 pc 00000000004383ac /system/lib64/libart.so (_ZN3art7Runtime7AborterEPKc+24)
2020-06-02 20:53:14.899 19248-19248/? A/DEBUG: #04 pc 0000000000522ab4 /system/lib64/libart.so (_ZN7android4base10LogMessageD1Ev+900)
2020-06-02 20:53:14.899 19248-19248/? A/DEBUG: #05 pc 0000000000462858 /system/lib64/libart.so (_ZNK3art6Thread24AssertNoPendingExceptionEv+1144)
2020-06-02 20:53:14.902 19248-19248/? A/DEBUG: #06 pc 0000000000127dac /system/lib64/libart.so (_ZN3art11ClassLinker9FindClassEPNS_6ThreadEPKcNS_6HandleINS_6mirror11ClassLoaderEEE+64)
2020-06-02 20:53:14.903 19248-19248/? A/DEBUG: #07 pc 0000000000311ec4 /system/lib64/libart.so (_ZN3art3JNI9FindClassEP7_JNIEnvPKc+1432)
2020-06-02 20:53:14.903 19248-19248/? A/DEBUG: #08 pc 0000000000068698 /data/app/com.stompai.kick-2yS5YP_5sv5B-eZMR3oZbA==/lib/arm64/libfxlib.so (Java_com_mobileer_androidfxlab_NativeInterface_getEffects+88)
2020-06-02 20:53:14.903 19248-19248/? A/DEBUG: #09 pc 000000000004590c /data/app/com.stompai.kick-2yS5YP_5sv5B-eZMR3oZbA==/oat/arm64/base.odex (offset 0x2c000)

如您所见,错误是
java.lang.ClassNotFoundException: Didn't find class "com.mobileer.androidfxlab.datatype.EffectDescription

这是一个简单的类,位于
java/com/github/mobileer/androidfxlab/datatype/EffectDescription

我认为这与/ java文件夹中的Kotlin类有关,因此我将其移至 /kotlin/com/mobileer/androidfxlab/...,但相同的错误仍在继续。

我对这个问题一无所知。我尝试清理一个重建项目,并且我的一个 friend 在他的计算机上也遇到了同样的问题,因此这看起来不像是构建错误。

最佳答案

这似乎是一个Proguard问题。

解决方案1:

如果要保持激活proguard,

将以下内容添加到proguard-rules.pro文件

-keep class com.mobileer.** { *; }

否则,如果您不希望激活proguard

解决方案2:

minifyEnabled false中设置 build.gradle

关于android - Android应用错误:未找到Kotlin类,但仅在Release apk上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62163245/

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