gpt4 book ai didi

android - 如何修复 Android 上的 dalvik.system.BaseDexClassLoader.findClass ClassNotFoundException?

转载 作者:太空狗 更新时间:2023-10-29 13:03:29 26 4
gpt4 key购买 nike

我在 Google Play 控制台上收到 dalvik.system.BaseDexClassLoader.findClass ClassNotFoundException 崩溃报告。崩溃几乎只发生在运行 OS 8 Oreo 的三星 Galaxy 7-9 上,占 5% 的用户。我在办公室里有一台带奥利奥的三星 7,我已经在三星远程测试实验室尝试了所有设备,但我无法重现崩溃。无论有没有 multidex,都会发生崩溃,我已经清除了缓存,重建并禁用了 Instant Run。直到我把targetSdkVersion改成26后才出现这个问题。Android Studio,gradle build。由于我无法重现崩溃,我只能随机更改并上传到 Playstore,然后在第二天检查崩溃报告。提前致谢!

Samsung Galaxy S9 (starqltesq), Android 8.0
Report 1

java.lang.RuntimeException:
at android.app.ActivityThread.handleReceiver (ActivityThread.java:3374)
at android.app.ActivityThread.-wrap18 (Unknown Source)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1780)
at android.os.Handler.dispatchMessage (Handler.java:105)
at android.os.Looper.loop (Looper.java:164)
at android.app.ActivityThread.main (ActivityThread.java:6938)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)
Caused by: java.lang.ClassNotFoundException:
at dalvik.system.BaseDexClassLoader.findClass (BaseDexClassLoader.java:93)
at java.lang.ClassLoader.loadClass (ClassLoader.java:379)
at java.lang.ClassLoader.loadClass (ClassLoader.java:312)
at android.app.ActivityThread.handleReceiver (ActivityThread.java:3369)

编辑应用构建 .gradle:

android {
compileSdkVersion 27
buildToolsVersion '25.0.0'
useLibrary 'org.apache.http.legacy'

defaultConfig {
minSdkVersion 17
targetSdkVersion 26
multiDexEnabled false
}
buildTypes {
release {
minifyEnabled false
if (is_main_app) {
signingConfig signingConfigs.releaseMain
} else if (is_simutrader_app) {
signingConfig signingConfigs.releaseSimutrader
} else {
signingConfig signingConfigs.releaseTsx
}
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

dependencies {
androidTestCompile 'junit:junit:4.12'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':volley')
compile files('libs/gson-2.3.1.jar')
compile 'io.branch.sdk.android:library:1.+'
compile files('libs/mpandroidchartlibrary-2-0-9.jar')
compile 'com.thebluealliance:spectrum:0.5.0'
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
compile 'com.android.support:appcompat-v7:27.1.0'
compile 'com.android.support:cardview-v7:27.1.0'
compile 'com.android.support:design:27.1.0'
compile 'com.android.support:support-v4:27.1.0'
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile 'com.google.android.gms:play-services-gcm:11.+'
compile 'com.google.android.gms:play-services-analytics:11.+'

compile 'com.google.firebase:firebase-core:11.+'

compile 'com.urbanairship.android:urbanairship-sdk:8.7.+'
// compile 'com.android.support:multidex:1.0.3'

}

apply plugin: 'com.google.gms.google-services'

最佳答案

我有解决方案。我将 NewRelic 添加到构建中并得到了这个:

CRASH TYPE SUMMARY
LOCATION
BaseDexClassLoader.java line 93 in dalvik.system.BaseDexClassLoader.findClass()
EXCEPTION
java.lang.ClassNotFoundException
MESSAGE
Didn't find class "com.urbanairship.push.GCMPushReceiver" on path: DexPathList[[zip file "/data/app/com.****.android-tUaBU1BXe0VaMGy9WlkUGA==/base.apk"],nativeLibraryDirectories=[/data/app/com.*****.android-tUaBU1BXe0VaMGy9WlkUGA==/lib/arm64, /system/lib64, /system/vendor/lib64]]

这告诉我 com.urbanairship.push.GCMPushReceiver 是罪魁祸首。所以跟踪库是一个有用的问题解决工具。谢谢回复!

附注作为一般观察,很多 SO“您是否尝试过更改......插入随机设置......?这保证有效!”回复在很大程度上不是很有帮助。

关于android - 如何修复 Android 上的 dalvik.system.BaseDexClassLoader.findClass ClassNotFoundException?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52251245/

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