jhansireddy / AndroidScannerDemo

ScanLibrary is an android document scanning library built on top of OpenCV, using the app you will be able to select the exact edges and crop the document accordingly from the selected 4 edges and change the perspective transformation of the cropped image.
MIT License
1.07k stars 472 forks source link

capturing Doesn't work on android 10 #142

Open OmkarSsawant opened 3 years ago

OmkarSsawant commented 3 years ago

On API 29 , when , I capture image . I get this error


2020-10-24 20:44:58.883 6744-6744/com.android.camera2 E/CAM_StateSavePic: exception while saving result to URI: Optional.of(content://com.example.provider/quick_scans/QuickScans/IMG_20201024_204438.jpg)
    java.io.FileNotFoundException: open failed: ENOENT (No such file or directory)
        at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:149)
        at android.content.ContentProviderProxy.openAssetFile(ContentProviderNative.java:631)
        at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1521)
        at android.content.ContentResolver.openOutputStream(ContentResolver.java:1227)
        at android.content.ContentResolver.openOutputStream(ContentResolver.java:1203)
        at com.android.camera.captureintent.state.StateSavingPicture.onEnter(StateSavingPicture.java:85)
        at com.android.camera.captureintent.stateful.StateMachineImpl.jumpToState(StateMachineImpl.java:62)
        at com.android.camera.captureintent.stateful.StateMachineImpl.processEvent(StateMachineImpl.java:110)
        at com.android.camera.captureintent.state.StateOpeningCamera$9.onClick(StateOpeningCamera.java:307)
        at android.view.View.performClick(View.java:7125)
        at android.view.View.performClickInternal(View.java:7102)
        at android.view.View.access$3500(View.java:801)
        at android.view.View$PerformClick.run(View.java:27336)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
2020-10-24 20:44:59.935 3262-3457/com.google.android.gms.persistent E/aoob: Phenotype API error. Event # ccoz@1527f2fe, EventCode: 12 [CONTEXT service_id=51 ]
    aonf: 29503
        at aooh.b(:com.google.android.gms@202414022@20.24.14 (040700-319035315):27)
        at aoob.a(:com.google.android.gms@202414022@20.24.14 (040700-319035315):91)
        at aoob.a(:com.google.android.gms@202414022@20.24.14 (040700-319035315):86)
        at aabt.run(:com.google.android.gms@202414022@20.24.14 (040700-319035315):9)
        at bnin.run(:com.google.android.gms@202414022@20.24.14 (040700-319035315):2)
        at soy.b(:com.google.android.gms@202414022@20.24.14 (040700-319035315):12)
        at soy.run(:com.google.android.gms@202414022@20.24.14 (040700-319035315):7)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at sux.run(:com.google.android.gms@202414022@20.24.14 (040700-319035315):0)
        at java.lang.Thread.run(Thread.java:919)

Please help me to find a solution .

Rohitsachdeva commented 3 years ago

same issue facing me too

sunil-singh-chaudhary commented 3 years ago

did you add android:requestLegacyExternalStorage="true" on manifest inside application tag

mishraaditya595 commented 3 years ago

did you add android:requestLegacyExternalStorage="true" on manifest inside application tag

That won't work from Android 11 onwards.

HenryTH45 commented 3 years ago

Did you Find a Solution?

vivekcubeztech commented 3 years ago

same issue...any solution.?

did you add android:requestLegacyExternalStorage="true" on manifest inside application tag

its doesn't work.

ashwinjawale24 commented 3 years ago

@OmkarSsawant i figure out the solution Remove app manifest file provider beacause scanlibrary manifest has its own fileprovider that will work, its working for me

mishraaditya595 commented 3 years ago

@OmkarSsawant i figure out the solution Remove app manifest file provider beacause scanlibrary manifest has its own fileprovider that will work, its working for me

Hey @OmkarSsawant, does your app target Android 11+ frameworks?

OmkarSsawant commented 3 years ago

@OmkarSsawant i figure out the solution Remove app manifest file provider beacause scanlibrary manifest has its own fileprovider that will work, its working for me

Hey @OmkarSsawant, does your app target Android 11+ frameworks?

Yes my app does target API 30 +

krabouilleur commented 1 year ago

@OmkarSsawant i figure out the solution Remove app manifest file provider beacause scanlibrary manifest has its own fileprovider that will work, its working for me

@ashwinjawale24 what do we need to remove ? and, in the manifest of scanlibrary or in the manifest of the app ?