NeutrinosPlatform / cordova-plugin-document-scanner

cordova plugin for document scan
https://www.neutrinos.co/
MIT License
85 stars 61 forks source link

Incorrect result or user canceled the action #89

Closed tiplonski closed 3 years ago

tiplonski commented 3 years ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

Hello,

I have updated to the newest version of 4.6.2 and I am running the newest version of Android on my Samsung Galaxy Note 20. I have also upgraded to the newest CLI of Ionic. The problem is I am getting the following error when pressing "OK" after taking a picture:

Incorrect result or user canceled the action

Please let me know if anyone else has had the same or similar error.

ChrisTomAlx commented 3 years ago

Could you try the beta version and see if that solves the issue. You can look at this comment to get an idea how to do this

Cheers and have a nice day :) Chris Neutrinos

tiplonski commented 3 years ago

Hello Chris,

That looked to resolve the issue. Thanks!

-Tim

ciclick commented 3 years ago

Hello Chris, I've just updated to the beta version but now Android Studio returns this errors:

Task :app:processDebugManifest FAILED /Users/toniarrebola/projectesGIT/bacs_app/android/app/src/main/AndroidManifest.xml:36:13-64 Error: Attribute provider#androidx.core.content.FileProvider@authorities value=(io.ionic.starter.fileprovider) from AndroidManifest.xml:36:13-64 is also present at [com.github.NeutrinosPlatform:scanlibrary:3.2] AndroidManifest.xml:32:13-76 value=(io.ionic.starter.com.scanlibrary.provider). Suggestion: add 'tools:replace="android:authorities"' to element at AndroidManifest.xml:34:9-42:20 to override. /Users/toniarrebola/projectesGIT/bacs_app/android/app/src/main/AndroidManifest.xml:41:17-51 Error: Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/file_paths) from AndroidManifest.xml:41:17-51 is also present at [com.github.NeutrinosPlatform:scanlibrary:3.2] AndroidManifest.xml:37:17-55 value=(@xml/provider_paths). Suggestion: add 'tools:replace="android:resource"' to element at AndroidManifest.xml:39:13-41:64 to override.

I use capacitor

Thank you

SauloLauers commented 3 years ago

I still have that same problem. It seems to happen on android 10 and bellow. I tried with may android versions, at android 11 it works.

` openScanner() { LoadingUtil.showLoading(this.loadingCtrl); let opts: DocumentScannerOptions = {};

    this.documentScanner.scanDoc(opts)
        .then((fileUri: string) => {
            console.log('documentScanner.scanDoc');
            console.log(fileUri);
            if (this.platform.is('android')) {
                this.getAndroidRealPath(fileUri).subscribe(realPath => {
                    this.enviaArquivoDigital(fileUri, this.getExtensaoArquivo(realPath));
                });
            } else {
                fileUri = fileUri.indexOf('file://') == 0 ? fileUri : 'file://' + fileUri;
                this.enviaArquivoDigital(fileUri, this.getExtensaoArquivo(fileUri));
            }
            LoadingUtil.dismiss();
        })
        .catch((error: any) => {
            LoadingUtil.dismiss();
            console.log('erro ao anexar arquivo da camera');
            console.log(error)
        });
}`

It used to work. But now we had to increase the mininum API lvl, and it started.

sergiuturus commented 3 years ago

Any updates on this? I get the same error + android studio error @ciclick described

Adding android:requestLegacyExternalStorage="true" to the AndroidManifest.xml seems to fix the problem but idk if this is a viable solution as @ChrisTomAlx noted here https://github.com/NeutrinosPlatform/cordova-plugin-document-scanner/issues/82#issuecomment-725231041