Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug report] NullPointerException crash #912

Open
fanwgwg opened this issue Jan 17, 2025 · 0 comments
Open

[Bug report] NullPointerException crash #912

fanwgwg opened this issue Jan 17, 2025 · 0 comments

Comments

@fanwgwg
Copy link

fanwgwg commented Jan 17, 2025

Describe the bug

Here's the stacktrace on Firebase Crashlytics

 Fatal Exception: java.lang.ExceptionInInitializerError:
       at com.google.android.gms.internal.mlkit_common.zzaq.zzg(com.google.mlkit:common@@18.10.0:2)
       at com.google.android.gms.internal.mlkit_common.zzaq.zzi(com.google.mlkit:common@@18.10.0:2)
       at com.google.mlkit.common.internal.CommonComponentRegistrar.getComponents(com.google.mlkit:common@@18.10.0:1)
       at com.google.firebase.components.ComponentRuntime.discoverComponents(ComponentRuntime.java:118)
       at com.google.firebase.components.ComponentRuntime.<init>(ComponentRuntime.java:100)
       at com.google.firebase.components.ComponentRuntime.<init>(ComponentRuntime.java:46)
       at com.google.firebase.components.ComponentRuntime$Builder.build(ComponentRuntime.java:407)
       at com.google.mlkit.common.sdkinternal.MlKitContext.zza(MlKitContext.java:10)
       at com.google.mlkit.common.internal.MlKitInitProvider.onCreate(com.google.mlkit:common@@18.10.0:3)
       at android.content.ContentProvider.attachInfo(ContentProvider.java:2388)
       at android.content.ContentProvider.attachInfo(ContentProvider.java:2358)
       at com.google.mlkit.common.internal.MlKitInitProvider.attachInfo(com.google.mlkit:common@@18.10.0:3)
       at android.app.ActivityThread.installProvider(ActivityThread.java:7268)
       at android.app.ActivityThread.installContentProviders(ActivityThread.java:6809)
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6726)
       at android.app.ActivityThread.access$1400(ActivityThread.java:237)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1924)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:223)
       at android.app.ActivityThread.main(ActivityThread.java:7741)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:966)

   Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'int java.util.AbstractCollection.size()' on a null object reference
       at com.google.android.gms.internal.mlkit_common.zzao.<init>(com.google.mlkit:common@@18.10.0)
       at com.google.android.gms.internal.mlkit_common.zzaq.<clinit>(com.google.mlkit:common@@18.10.0:1)
       at com.google.android.gms.internal.mlkit_common.zzaq.zzg(com.google.mlkit:common@@18.10.0:2)
       at com.google.android.gms.internal.mlkit_common.zzaq.zzi(com.google.mlkit:common@@18.10.0:2)
       at com.google.mlkit.common.internal.CommonComponentRegistrar.getComponents(com.google.mlkit:common@@18.10.0:1)
       at com.google.firebase.components.ComponentRuntime.discoverComponents(ComponentRuntime.java:118)
       at com.google.firebase.components.ComponentRuntime.<init>(ComponentRuntime.java:100)
       at com.google.firebase.components.ComponentRuntime.<init>(ComponentRuntime.java:46)
       at com.google.firebase.components.ComponentRuntime$Builder.build(ComponentRuntime.java:407)
       at com.google.mlkit.common.sdkinternal.MlKitContext.zza(MlKitContext.java:10)
       at com.google.mlkit.common.internal.MlKitInitProvider.onCreate(com.google.mlkit:common@@18.10.0:3)
       at android.content.ContentProvider.attachInfo(ContentProvider.java:2388)
       at android.content.ContentProvider.attachInfo(ContentProvider.java:2358)
       at com.google.mlkit.common.internal.MlKitInitProvider.attachInfo(com.google.mlkit:common@@18.10.0:3)
       at android.app.ActivityThread.installProvider(ActivityThread.java:7268)
       at android.app.ActivityThread.installContentProviders(ActivityThread.java:6809)
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6726)
       at android.app.ActivityThread.access$1400(ActivityThread.java:237)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1924)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:223)
       at android.app.ActivityThread.main(ActivityThread.java:7741)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:966)
        

To Reproduce

Seems like this happens upon app start or start in background by worker

Image
Image

Expected behavior
There should not be crash

SDK Info:

    implementation 'com.google.android.gms:play-services-mlkit-subject-segmentation:16.0.0-beta1'
    implementation 'com.google.android.gms:play-services-mlkit-document-scanner:16.0.0-beta1'
    implementation 'com.google.mlkit:digital-ink-recognition:18.1.0'

Smartphone:

  • Device/Simulator: 95% Google, 5% Waydroid
  • Device/Simulator OS: Android 11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant