googlesamples / mlkit

A collection of sample apps to demonstrate how to use Google's ML Kit APIs on Android and iOS
Apache License 2.0
3.5k stars 2.92k forks source link

implementation 'com.google.android.gms:play-services-mlkit-document-scanner:16.0.0-beta1' getting initialization error captured Failed to Scan: Feature not available in current version of Google on Android 13. Please Help it's urgent #823

Closed kiranNanda closed 3 months ago

kiranNanda commented 3 months ago

implementation 'com.google.android.gms:play-services-mlkit-document-scanner:16.0.0-beta1' getting initialization Failed to Scan: Feature not available in current version of Google on Android 13 OnePlus Nord CE 5G although working fine for OnePlus Nord 2 Android 13.Please help me I have implemented it my project and issue got rendered on demo mobile.

I am using below code to start scanning: GmsDocumentScannerOptions.Builder options = new GmsDocumentScannerOptions.Builder() .setResultFormats( GmsDocumentScannerOptions.RESULT_FORMAT_JPEG, GmsDocumentScannerOptions.RESULT_FORMAT_PDF) .setGalleryImportAllowed(false); options.setScannerMode(GmsDocumentScannerOptions.SCANNER_MODE_FULL); options.setPageLimit(12);

GmsDocumentScanning.getClient(options.build())
        .getStartScanIntent(this)
        .addOnSuccessListener(
                intentSender ->
                        scannerLauncher.launch(new IntentSenderRequest.Builder(intentSender).build()))
        .addOnFailureListener(
                e -> resultInfo = (getString(R.string.error_default_message, e.getMessage())));

It's getting compiler to .addOnFailureListener( e -> resultInfo = (getString(R.string.error_default_message, e.getMessage())));

OnePlus Nord CE 5G Android 13 although it's working fine for OnePlus Nord 2 Android 13.Please check it at your side too.

ai-plays commented 3 months ago

Hi kiranNanda, have you tried to update your Google Play services app to the latest version?

You can update in the following way:

On your phone, in Chrome, Google search "Google Play services". In the result card, there should be a button like "Upgrade" or "Update". Tap to update to the latest version. Feel free to re-open if you still cannot get it working after that.

kiranNanda commented 3 months ago

Thank you ai-plays it's working fine

SantoshInchalakaranji commented 2 months ago

Thank you ai-plays it's working fine

@kiranNanda What was your play services verision, and for what version you have upgraded. I am also getting similar exception and the document scanner not opening.

com.google.mlkit.common.MlKitException: Feature not available in the current version of the Google Play services at com.google.mlkit.vision.documentscanner.internal.zzb.getStartScanIntent(com.google.android.gms:play-services-mlkit-document-scanner@@16.0.0-beta1:23) How to solve ,

kiranNanda commented 2 months ago

I don't know the version because that error occurred only on one mobile and that is client mobile I had only told them to upgrade their mobile Google play services version

On Wed, Jun 12, 2024, 10:52 PM Santosh Inchalakaranji < @.***> wrote:

Thank you ai-plays it's working fine

@kiranNanda https://github.com/kiranNanda What was your play services verision, and for what version you have upgraded. I am also getting similar exception and the document scanner not opening.

com.google.mlkit.common.MlKitException: Feature not available in the current version of the Google Play services at com.google.mlkit.vision.documentscanner.internal.zzb.getStartScanIntent(com.google.android.gms:play-services-mlkit-document-scanner@ @16.0.0-beta1:23) How to solve ,

— Reply to this email directly, view it on GitHub https://github.com/googlesamples/mlkit/issues/823#issuecomment-2163554072, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGFPSCGSM32X62OXUORVKOTZHB7UHAVCNFSM6AAAAABIFDNFO6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRTGU2TIMBXGI . You are receiving this because you were mentioned.Message ID: @.***>

SantoshInchalakaranji commented 2 months ago

Thank you so much, The solution worked for me also by upgrading Google play services from Google play store.

On Wed, Jun 12, 2024, 11:00 PM kiranNanda @.***> wrote:

I don't know the version because that error occurred only on one mobile and that is client mobile I had only told them to upgrade their mobile Google play services version

On Wed, Jun 12, 2024, 10:52 PM Santosh Inchalakaranji < @.***> wrote:

Thank you ai-plays it's working fine

@kiranNanda https://github.com/kiranNanda What was your play services verision, and for what version you have upgraded. I am also getting similar exception and the document scanner not opening.

com.google.mlkit.common.MlKitException: Feature not available in the current version of the Google Play services at

com.google.mlkit.vision.documentscanner.internal.zzb.getStartScanIntent(com.google.android.gms:play-services-mlkit-document-scanner@ @16.0.0-beta1:23) How to solve ,

— Reply to this email directly, view it on GitHub < https://github.com/googlesamples/mlkit/issues/823#issuecomment-2163554072>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AGFPSCGSM32X62OXUORVKOTZHB7UHAVCNFSM6AAAAABIFDNFO6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRTGU2TIMBXGI>

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/googlesamples/mlkit/issues/823#issuecomment-2163567775, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWPOWA37ABXQIVQGU5UIIPDZHCATNAVCNFSM6AAAAABIFDNFO6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRTGU3DONZXGU . You are receiving this because you commented.Message ID: @.***>

kiranNanda commented 2 months ago

Glad it worked.

On Wed, Jun 12, 2024, 11:04 PM Santosh Inchalakaranji < @.***> wrote:

Thank you so much, The solution worked for me also by upgrading Google play services from Google play store.

On Wed, Jun 12, 2024, 11:00 PM kiranNanda @.***> wrote:

I don't know the version because that error occurred only on one mobile and that is client mobile I had only told them to upgrade their mobile Google play services version

On Wed, Jun 12, 2024, 10:52 PM Santosh Inchalakaranji < @.***> wrote:

Thank you ai-plays it's working fine

@kiranNanda https://github.com/kiranNanda What was your play services verision, and for what version you have upgraded. I am also getting similar exception and the document scanner not opening.

com.google.mlkit.common.MlKitException: Feature not available in the current version of the Google Play services at

com.google.mlkit.vision.documentscanner.internal.zzb.getStartScanIntent(com.google.android.gms:play-services-mlkit-document-scanner@

@16.0.0-beta1:23) How to solve ,

— Reply to this email directly, view it on GitHub <

https://github.com/googlesamples/mlkit/issues/823#issuecomment-2163554072>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AGFPSCGSM32X62OXUORVKOTZHB7UHAVCNFSM6AAAAABIFDNFO6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRTGU2TIMBXGI>

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub < https://github.com/googlesamples/mlkit/issues/823#issuecomment-2163567775>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AWPOWA37ABXQIVQGU5UIIPDZHCATNAVCNFSM6AAAAABIFDNFO6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRTGU3DONZXGU>

. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/googlesamples/mlkit/issues/823#issuecomment-2163574130, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGFPSCEYMQDXIY6GFYQ4PZTZHCBCLAVCNFSM6AAAAABIFDNFO6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRTGU3TIMJTGA . You are receiving this because you were mentioned.Message ID: @.***>