gpt4 book ai didi

java - 无法识别 java.lang.ClassNotFoundException BaseDexClassLoader 的来源

转载 作者:太空狗 更新时间:2023-10-29 22:55:56 25 4
gpt4 key购买 nike

正如我在开发人员控制台中看到的那样,我在我的 Android 应用程序中收到了很多来自用户的崩溃报告。我看到的堆栈跟踪是:

java.lang.RuntimeException:

at android.app.ActivityThread.handleReceiver (ActivityThread.java:2884)

at android.app.ActivityThread.-wrap14 (ActivityThread.java)

at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1565)

at android.os.Handler.dispatchMessage (Handler.java:111)

at android.os.Looper.loop (Looper.java:207)

at android.app.ActivityThread.main (ActivityThread.java:5728)

at java.lang.reflect.Method.invoke (Native Method)

at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:789)

at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:679)
Caused by: java.lang.ClassNotFoundException:
at dalvik.system.BaseDexClassLoader.findClass (BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass (ClassLoader.java:511)
at java.lang.ClassLoader.loadClass (ClassLoader.java:469)
at android.app.ActivityThread.handleReceiver (ActivityThread.java:2879)

没有引用我的应用程序包名称。我正在使用 Eclipse 进行开发。是不是和multidex有关。我需要切换到 Android Studio 来解决这个问题吗?我无法理解堆栈跟踪背后的基本原因,因此我无法为其寻找解决方案。

注意:我的应用程序中添加了 google play 服务、IAP 和 OneSignal Sdk

最佳答案

I would personally say that Android Studio has the edge over the two.Android studio is becoming more popular day by day among the android development community and also the open source community. Android Studio or Eclipse?

阅读 Migrate to Android Studio .

Migrating your projects to Android Studio requires adapting to a new project structure, build system, and IDE functionality. If you are migrating an Android project from Eclipse, Android Studio provides an import tool so you can quickly move your existing code into Android Studio projects and Gradle-based build files.

Logcat 抛出

Caused by: java.lang.ClassNotFoundException:
at dalvik.system.BaseDexClassLoader.findClass (BaseDexClassLoader.java:56)

BaseDexClassLoader 各种 dex-based ClassLoader 实现之间通用功能的基类。

In order to configure your app project to use a MultiDex configuration, you must make the following modifications, depending on the minimum Android version that your app supports.

设置multiDexEnabled true到您的 build.gradle module-level 文件,如下所示:

    android {
compileSdkVersion //
buildToolsVersion //

defaultConfig {
...
minSdkVersion 14
targetSdkVersion //
...

// Enabling multidex support.
multiDexEnabled true
}
...
}

dependencies {
compile 'com.android.support:multidex:1.0.1'
}

可以查看 DexIndexOverflowException .

关于java - 无法识别 java.lang.ClassNotFoundException BaseDexClassLoader 的来源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46108106/

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