gpt4 book ai didi

android - Crashlytics 在应用程序启动时因 Resources$NotFoundException 而崩溃

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:20:47 24 4
gpt4 key购买 nike

我最近检查了我的 google play 崩溃,发现我有成千上万的用户遇到了这个崩溃,但在 crashlytics 上没有:

java.lang.RuntimeException: 
at android.app.ActivityThread.installProvider (ActivityThread.java:7110)
at android.app.ActivityThread.installContentProviders (ActivityThread.java:6594)
at android.app.ActivityThread.handleBindApplication (ActivityThread.java:6498)
at android.app.ActivityThread.-wrap2 (Unknown Source)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1963)
at android.os.Handler.dispatchMessage (Handler.java:108)
at android.os.Looper.loop (Looper.java:166)
at android.app.ActivityThread.main (ActivityThread.java:7425)
at java.lang.reflect.Method.invoke (Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:245)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:921)
Caused by: android.content.res.Resources$NotFoundException:
at android.content.res.ResourcesImpl.getResourcePackageName (ResourcesImpl.java:325)
at android.content.res.Resources.getResourcePackageName (Resources.java:2099)
at io.fabric.sdk.android.services.common.CommonUtils.getResourcePackageName (CommonUtils.java:768)
at io.fabric.sdk.android.services.common.CommonUtils.getResourcesIdentifier (CommonUtils.java:518)
at io.fabric.sdk.android.services.common.CommonUtils.getBooleanResourceValue (CommonUtils.java:499)
at io.fabric.sdk.android.services.common.FirebaseInfo.isFirebaseCrashlyticsEnabled (FirebaseInfo.java:56)
at com.crashlytics.android.CrashlyticsInitProvider.shouldInitializeFabric (CrashlyticsInitProvider.java:85)
at com.crashlytics.android.CrashlyticsInitProvider.onCreate (CrashlyticsInitProvider.java:25)
at android.content.ContentProvider.attachInfo (ContentProvider.java:1919)
at android.content.ContentProvider.attachInfo (ContentProvider.java:1894)
at android.app.ActivityThread.installProvider (ActivityThread.java:7107)
at android.app.ActivityThread.installContentProviders (ActivityThread.java:6594)
at android.app.ActivityThread.handleBindApplication (ActivityThread.java:6498)
at android.app.ActivityThread.-wrap2 (Unknown Source)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1963)
at android.os.Handler.dispatchMessage (Handler.java:108)
at android.os.Looper.loop (Looper.java:166)
at android.app.ActivityThread.main (ActivityThread.java:7425)
at java.lang.reflect.Method.invoke (Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:245)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:921)

stackoverflow 上的类似问题: Question 1 Question 2

我有一个正在进行的支持 Fabric 的电子邮件线程,但他们认为发生这种情况的唯一原因是因为:

2018-12-09 14:39:09.899 [DEBUG] (Thread-6) com.crashlytics - Crashlytics found ProjectName, a module missing required artifacts: Root: E:\DevelopmentEnvironment\Projects\ProjectName(Exists), Manifest: E:\DevelopmentEnvironment\Projects\ProjectName\AndroidManifest.xml (Doesn't Exist), Res: E:\DevelopmentEnvironment\Projects\ProjectName\res (Doesn't Exist), Assets: E:\DevelopmentEnvironment\Projects\ProjectName\assets (Doesn't Exist), Data: C:\Users\hvkro_000.crashlytics\com.crashlytics.tools\ProjectName-bec53d32b3aec63f870c6dd19f7186ae46e1e3a1 (Doesn't Exist), NDK_OUT: null (Doesn't Exist), NDK_LIBS_OUT: null (Doesn't Exist) , (Maven? false), (Gradle false), (Using any IML? true), (Using any Default? true) (Manifest-Found-In: root? false src/main? false) (Res-Found-In: root? false src/main? false) (Assets-Found-In: root? false src/main? false)

We can't find your manifest. I believe this is the problem.

我无法在我这边重现这个问题,但正如您在下面看到的,相当多的用户正在发生这个问题。我已经研究了很长时间,但我无法弄清楚是什么导致了这个问题。任何帮助将不胜感激。 enter image description here

最佳答案

经过一个小改动后,我能够解决这个问题。以前我是这样初始化 Fabric 的:

Fabric.with(this, new Crashlytics.Builder().core(crashlyticsCore).build());

然后我将它更新为如下所示:

final Crashlytics crashlytics = new Crashlytics.Builder().core(crashlyticsCore).build();
final Fabric fabric = new Fabric.Builder(this)
.kits(crashlytics)
.debuggable(BuildConfig.DEBUG)
.build();
Fabric.with(fabric);

此更改为我解决了这个问题。但是 fabric 团队应该比我先发现它,因为我已经与他们分享了我是如何初始化 fabric 的。之前的代码是 fabric 在他们的文档中如何被初始化的。他们至少应该反对这种初始化方式。

关于android - Crashlytics 在应用程序启动时因 Resources$NotFoundException 而崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53774238/

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