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

Occasional crash on Pixel 5 Android 13 #76

Closed
kyze8439690 opened this issue Oct 26, 2022 · 5 comments
Closed

Occasional crash on Pixel 5 Android 13 #76

kyze8439690 opened this issue Oct 26, 2022 · 5 comments
Labels
improvement New feature or request
Milestone

Comments

@kyze8439690
Copy link

Integrate with: implementation("io.github.g00fy2.quickie:quickie-bundled:1.5.1")

Crash log:

Fatal Exception: java.lang.IllegalStateException: MlKitContext has not been initialized
       at com.google.android.gms.common.internal.Preconditions.checkState(com.google.android.gms:play-services-basement@@18.1.0:2)
       at com.google.mlkit.common.sdkinternal.MlKitContext.getInstance(com.google.mlkit:common@@18.5.0:1)
       at com.google.mlkit.vision.barcode.BarcodeScanning.getClient(BarcodeScanning.java:3)
       at io.github.g00fy2.quickie.QRCodeAnalyzer$barcodeScanner$2.invoke(QRCodeAnalyzer.kt:24)
       at io.github.g00fy2.quickie.QRCodeAnalyzer$barcodeScanner$2.invoke(QRCodeAnalyzer.kt:18)
       at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
       at io.github.g00fy2.quickie.QRCodeAnalyzer.getBarcodeScanner(QRCodeAnalyzer.kt:18)
       at io.github.g00fy2.quickie.QRCodeAnalyzer.analyze(QRCodeAnalyzer.kt:42)
       at androidx.camera.core.ImageAnalysis$$ExternalSyntheticLambda2.b(R8$$SyntheticClass:3)
       at androidx.camera.core.ImageAnalysisAbstractAnalyzer.lambda$analyzeImage$0(ImageAnalysisAbstractAnalyzer.java:285)
       at androidx.camera.core.ImageAnalysisAbstractAnalyzer$$InternalSyntheticLambda$8$864b24cc058c102b9ababe9f2eaf5f45916e7a7a0663a2b450741580c02ea23e$0.run(ImageAnalysisAbstractAnalyzer.java:66)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
       at java.lang.Thread.run(Thread.java:1012)
@G00fY2
Copy link
Owner

G00fY2 commented Oct 27, 2022

Hi and thanks for reaching out.

This library does nothing that could affect the default MlKitContext initialization. The initialization should happen automatically by the com.google.mlkit.common.internal.MlKitInitProvider content provider added by the MlKit dependency internally. There is nothing I can do to affect this.

Did you maybe disabled any content provider in your app/manifest?

Maybe you can check if the ML Kit Vision Quickstart Sample App is working for you.

There are also some issues in the MlKit GitHub project which could may help you.

Otherwise please create a bug ticket in the Google issue tracker and/or in their GitHub issues.

@G00fY2 G00fY2 closed this as completed Oct 27, 2022
@kyze8439690
Copy link
Author

Is it possible for quickie to catch this exception and invoke something like 'failure callback' instead?

@G00fY2
Copy link
Owner

G00fY2 commented Oct 27, 2022

Yeah we should be able to catch this exception. Will try to add this in a future release. But thats nothing Google mentions/recommends in it's docs about MlKit. The issue should be fixed in MlKit. Maybe you can still create a ticket there.

@G00fY2 G00fY2 reopened this Oct 27, 2022
@G00fY2 G00fY2 added this to the 1.5.2 milestone Oct 27, 2022
@G00fY2 G00fY2 added the improvement New feature or request label Oct 27, 2022
@G00fY2
Copy link
Owner

G00fY2 commented Oct 27, 2022

This is fixed with f164aa9 (which is included in 1.5.2).

@G00fY2 G00fY2 closed this as completed Oct 27, 2022
@kyze8439690
Copy link
Author

Yeah we should be able to catch this exception. Will try to add this in a future release. But thats nothing Google mentions/recommends in it's docs about MlKit. The issue should be fixed in MlKit. Maybe you can still create a ticket there.

Thanks for that, I see somebody have open issue on mlkit github repo issue already.

googlesamples/mlkit#565

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants