gpt4 book ai didi

android - 初始化时出现 Crashlytics 异常

转载 作者:行者123 更新时间:2023-11-30 05:11:03 27 4
gpt4 key购买 nike

在 android 应用程序上初始化 crashlytics 时出现以下异常

12-12 10:55:54.104 15540 15621 E CrashlyticsCore: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Attempt to get length of null array
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at java.util.concurrent.FutureTask.report(FutureTask.java:94)
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at java.util.concurrent.FutureTask.get(FutureTask.java:164)
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at com.crashlytics.android.core.CrashlyticsBackgroundWorker.submitAndWait(CrashlyticsBackgroundWorker.java:43)
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at com.crashlytics.android.core.CrashlyticsController.finalizeNativeReport(CrashlyticsController.java:967)
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at com.crashlytics.android.core.CrashlyticsCore.doInBackground(CrashlyticsCore.java:346)
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at com.crashlytics.android.core.CrashlyticsCore.doInBackground(CrashlyticsCore.java:45)
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at io.fabric.sdk.android.InitializationTask.doInBackground(InitializationTask.java:63)
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at io.fabric.sdk.android.InitializationTask.doInBackground(InitializationTask.java:28)
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at io.fabric.sdk.android.services.concurrency.AsyncTask$2.call(AsyncTask.java:311)
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
--
--
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at java.lang.Thread.run(Thread.java:761)
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: Caused by: java.lang.NullPointerException: Attempt to get length of null array
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at com.crashlytics.android.core.NativeFileUtils.filter(NativeFileUtils.java:43)
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at com.crashlytics.android.core.NativeFileUtils.minidumpFromDirectory(NativeFileUtils.java:53)
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at com.crashlytics.android.core.CrashlyticsController.finalizeMostRecentNativeCrash(CrashlyticsController.java:903)
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at com.crashlytics.android.core.CrashlyticsController.access$1700(CrashlyticsController.java:69)
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at com.crashlytics.android.core.CrashlyticsController$16.call(CrashlyticsController.java:977)
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at com.crashlytics.android.core.CrashlyticsController$16.call(CrashlyticsController.java:967)
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at io.fabric.sdk.android.services.common.ExecutorUtils$1$1.onRun(ExecutorUtils.java:75)
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at io.fabric.sdk.android.services.common.BackgroundPriorityRunnable.run(BackgroundPriorityRunnable.java:30)
--
--
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at io.fabric.sdk.android.services.common.ExecutorUtils$1$1.onRun(ExecutorUtils.java:75)
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: at io.fabric.sdk.android.services.common.BackgroundPriorityRunnable.run(BackgroundPriorityRunnable.java:30)
12-12 10:55:54.104 15540 15621 E CrashlyticsCore: ... 1 more
12-12 10:55:54.124 15540 15621 E CrashlyticsCore: Crashlytics encountered a problem during asynchronous initialization.
12-12 10:55:54.124 15540 15621 E CrashlyticsCore: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference
12-12 10:55:54.124 15540 15621 E CrashlyticsCore: at com.crashlytics.android.core.CrashlyticsController.finalizeNativeReport(CrashlyticsController.java:967)
12-12 10:55:54.124 15540 15621 E CrashlyticsCore: at com.crashlytics.android.core.CrashlyticsCore.doInBackground(CrashlyticsCore.java:346)
12-12 10:55:54.124 15540 15621 E CrashlyticsCore: at com.crashlytics.android.core.CrashlyticsCore.doInBackground(CrashlyticsCore.java:45)
12-12 10:55:54.124 15540 15621 E CrashlyticsCore: at io.fabric.sdk.android.InitializationTask.doInBackground(InitializationTask.java:63)
12-12 10:55:54.124 15540 15621 E CrashlyticsCore: at io.fabric.sdk.android.InitializationTask.doInBackground(InitializationTask.java:28)
12-12 10:55:54.124 15540 15621 E CrashlyticsCore: at io.fabric.sdk.android.services.concurrency.AsyncTask$2.call(AsyncTask.java:311)
12-12 10:55:54.124 15540 15621 E CrashlyticsCore: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
12-12 10:55:54.124 15540 15621 E CrashlyticsCore: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)

我的配置如下:

在 Application.java 上

final Fabric fabric = new Fabric.Builder(this)
.kits(new Crashlytics(), new CrashlyticsNdk())
.debuggable(true)
.build();
Fabric.with(fabric);

在 build.gradle 上

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

crashlytics {
enableNdk true
// If using the Android plugin for Gradle version 2.2.0+ with the externalNativeBuild DSL,
// you should remove the androidNdkOut and androidNdkLibsOut properties, as these paths will
// automatically be detected by the Fabric plugin.
androidNdkOut 'src/main/obj'
androidNdkLibsOut 'src/main/libs'
manifestPath 'src/main/AndroidManifest.xml'
}

我试图在我的 native 代码上造成这样的崩溃:

throw std::runtime_error {"Please crash"} ;

崩溃发生了很多次,没有报告原生崩溃。

PS:我使用的是 crashlytics 2.9.6 和 crashlytics_ndk 2.0.5。PSS:Java 崩溃运行正常。

我错过了什么吗?

最佳答案

确保您拥有来自 crashlytics-ndk 的正确版本说明。

2019 年 14 月 2 日:

implementation 'com.google.firebase:firebase-core:16.0.9'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'com.crashlytics.sdk.android:crashlytics-ndk:2.1.0'

还有 firebase initialize automatically在内容提供商的帮助下!所以你应该从代码中删除 Fabric 初始化!

关于android - 初始化时出现 Crashlytics 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53739688/

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