NeutrinosPlatform / cordova-plugin-document-scanner

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

Issiues with android 10 #85

Closed AmanteaManuel closed 3 years ago

AmanteaManuel commented 3 years ago

Hi im trying to make an ionic app with the plugin but on android 10 throw this error when accept the picturo with the camera: "Incorrect result or user canceled the action". Someone knows what could happening?. i could try the app on android 9 and works fine.

ChrisTomAlx commented 3 years ago

Hey @AmanteaManuel Could you share a minimalistic project in which this issue can be recreated?

Cheers and have a nice day :) Chris Neutrinos

AmanteaManuel commented 3 years ago

thxs for the reply here i let you the repo: https://github.com/AmanteaManuel/ScanApp

AmanteaManuel commented 3 years ago

@ChrisTomAlx could you see something??

ChrisTomAlx commented 3 years ago

Unfortunately I could not get to this. Could you share the android studio debug logs ?

Cheers and have a nice day :) Chris Neutrinos

AmanteaManuel commented 3 years ago

Sorry im not fully familiar with Android Studio but this is the logcat: logcat.txt

and this is the verbose logcat logcat-verbose.txt

ChrisTomAlx commented 3 years ago

Hey @AmanteaManuel I could not get your project running so I created a new project with ionic and tested on Android 10. Seems to be working fine. Could you either send me an apk and/or the steps to get your project up and running post git clone. Sorry I am an ionic newbie.

Also I would urge you to test on another android 10 device as well. It could be that the make of this particular phone is causing the issue.

Cheers and have a nice day :) Chris Neutrinos

AmanteaManuel commented 3 years ago

sure, here i let the apk: https://drive.google.com/file/d/1fyxoCq_LOIROUY7cnnuN2e8UjSpSaG-l/view?usp=sharing. And i going to look for another phone to test it.

ChrisTomAlx commented 3 years ago

@AmanteaManuel The apk seems to be working. Are you having trouble with both camera and gallery options ?

Cheers and have a nice day :) Chris Neutrinos

anshumanfs commented 3 years ago

I am having the issue in Android 10 that , after I clicks image it is not doing anything . But from gallery selection it works fine

I tried a lot but no fixes at all

@ChrisTomAlx please help with this

Mihir-Karbelkar commented 3 years ago

Hey, I am also facing the same issue with android API 29 on emulator. The rest of the versions work fine. The only issue is API 29 (android 10) rest of the APIs work just fine.

Mihir-Karbelkar commented 3 years ago

@anshuman61 add

android:requestLegacyExternalStorage="true"

to your android manifest file for a temporary workaround.

macsupport commented 3 years ago

Same problem with SDK 29. Works in 28 or less fine.

Mihir-Karbelkar commented 3 years ago

Try using this android:requestLegacyExternalStorage="true" worked in my case @macsupport

macsupport commented 3 years ago

Try using this android:requestLegacyExternalStorage="true" worked in my case @macsupport

Sorry, I forgot to add that I did try that. Added it to AndroidManifest.xml, but no change, still fails. Unless I need to add it elsewhere?

Mihir-Karbelkar commented 3 years ago

Not sure as to why it's not working on your device. I have one plus Nord with Android 10 and it works fine after adding that. Other than that I can't help since I am also using this plug-in out of the box maybe the creator will be able to help better.

anshumanfs commented 3 years ago

Thanks @Mihir-Karbelkar it worked perfectly

AmanteaManuel commented 3 years ago

android:requestLegacyExternalStorage="true"

this work for me, in my case i add it on config.xml: l left and example for futures persons with the same issue

Under the tag <platform name="android"> add the following snippet within config,xml :-

 <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
    <application android:networkSecurityConfig="@xml/network_security_config" />
    <application android:usesCleartextTraffic="true" />
    <application android:requestLegacyExternalStorage="true" />
 </edit-config>