CleanSCAN icon indicating copy to clipboard operation
CleanSCAN copied to clipboard

Scan button open the default camera app and then nothing happen

Open ElucGeek opened this issue 3 years ago • 7 comments

I've just tried this app on a phone with LineageOS and Open Camera as default camera. When I click scan I get the open camera to open (I was expecting to have an in app camera function with edge detection or something), then either I can take a photo but nothing happen or the screen is black like if the camera was covered (with open camera UI overlay). Open camera works fine and all other scanner app I tried work fine as well. Any idea what's going wrong here?

ElucGeek avatar Aug 25 '20 12:08 ElucGeek

Can you share the logs may be we can find some errors from there

babanomania avatar Sep 14 '20 20:09 babanomania

check an manually assign the camera permission and check if works fine, may be we need to use a different camera2 permissions for this scenario

babanomania avatar Sep 20 '20 12:09 babanomania

Hello, thanks for addressing this. Sorry I'm not sure how to safely extra a log of this? I've tried again, in fact I always have the second scenario now. It open my default camera app, that is OpenCamera (from F-Droid) and I have the complete app UI like if I take a normal picture from OpenCamera but the picture is black. However if I still shoot a picture blindinly, it work and the picture end up in CleanScan. Even better, from the OpenCamera UI I open the gallery with the thumb from last picture taken (bottom right) it show me the gallery and when I hit back, I'm back to OpenCamera and this time I see the camera stream and I can take the picture correctly.

I went even further in my testing. If I remove the default "Open by default" setting for Camera (the native camera app) and OpenCamera I then have the choice again to use either of them from CleanScan with the selection screen "Capture image with Camera. -> Just once. or -> Always or Use a different app: "Open Camera". If I select any of these app but use the "just one" button, it works directly fine. But as soon as I select one or the other app as default camera app for CleanScan, the issue is happening (so it happens with both camera app). So it doesn't looks like an issue with the camera app.

I checked the camera permission of CleanScan and it was on. Just to be sure I turned it off and on again but it didn't solve the issue.

Then I found 2 others issues but I might report them separately.

ElucGeek avatar Sep 21 '20 13:09 ElucGeek

the same issue after taping on scan button it again shows (your list is empty) given all permission

2020-11-10 21:28:28.202 14723-14723/com.babanomania.pdfscanner E/WindowManager: android.view.WindowLeaked: Activity com.scanlibrary.ScanActivity has leaked window DecorView@b193ced[ScanActivity] that was originally added here at android.view.ViewRootImpl.<init>(ViewRootImpl.java:623) at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:377) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:96) at android.app.Dialog.show(Dialog.java:344) at com.scanlibrary.ScanActivity.onTrimMemory(ScanActivity.java:140) at android.app.ActivityThread.handleTrimMemory(ActivityThread.java:6105) at android.app.ActivityThread.access$1200(ActivityThread.java:224) at android.app.ActivityThread$ApplicationThread.lambda$scheduleTrimMemory$0(ActivityThread.java:1584) at android.app.-$$Lambda$ActivityThread$ApplicationThread$tUGFX7CUhzB4Pg5wFd5yeqOnu38.accept(Unknown Source:8) at com.android.internal.util.function.pooled.PooledLambdaImpl.doInvoke(PooledLambdaImpl.java:271) at com.android.internal.util.function.pooled.PooledLambdaImpl.invoke(PooledLambdaImpl.java:195) at com.android.internal.util.function.pooled.OmniFunction.run(OmniFunction.java:86) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1031) at android.view.Choreographer.doCallbacks(Choreographer.java:854) at android.view.Choreographer.doFrame(Choreographer.java:791) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1016) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:224) at android.app.ActivityThread.main(ActivityThread.java:7560) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

    at com.scanlibrary.ScanActivity.onTrimMemory(ScanActivity.java:140)

ghanimkhan avatar Nov 10 '20 15:11 ghanimkhan

2020-12-10 14:36:12.121 21204-21204/com.babanomania.pdfscanner W/System.err: java.lang.NullPointerException: Attempt to get length of null array 2020-12-10 14:36:12.121 21204-21204/com.babanomania.pdfscanner W/System.err: at com.scanlibrary.PickImageFragment.clearTempImages(PickImageFragment.java:75) 2020-12-10 14:36:12.121 21204-21204/com.babanomania.pdfscanner W/System.err: at com.scanlibrary.PickImageFragment.createImageFile(PickImageFragment.java:141) 2020-12-10 14:36:12.121 21204-21204/com.babanomania.pdfscanner W/System.err: at com.scanlibrary.PickImageFragment.openCamera(PickImageFragment.java:125) 2020-12-10 14:36:12.121 21204-21204/com.babanomania.pdfscanner W/System.err: at com.scanlibrary.PickImageFragment.handleIntentPreference(PickImageFragment.java:85) 2020-12-10 14:36:12.121 21204-21204/com.babanomania.pdfscanner W/System.err: at com.scanlibrary.PickImageFragment.init(PickImageFragment.java:66) 2020-12-10 14:36:12.121 21204-21204/com.babanomania.pdfscanner W/System.err: at com.scanlibrary.PickImageFragment.onCreateView(PickImageFragment.java:56)

I found this error. It seems like final File sd = Environment.getExternalStorageDirectory(); is deprecated on android 10. So that, the directory is not created.

fityanrahman avatar Dec 10 '20 07:12 fityanrahman

Same Issue ,

the app open the phone native camera app then return null data in result. 2021-07-05 12:54:08.234 15090-15090/com.babanomania.pdfscanner E/AndroidRuntime: FATAL EXCEPTION: main Process: com.babanomania.pdfscanner, PID: 15090 java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=2, result=0, data=null} to activity {com.babanomania.pdfscanner/com.babanomania.pdfscanner.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.os.Bundle android.content.Intent.getExtras()' on a null object reference at android.app.ActivityThread.deliverResults(ActivityThread.java:4938) at android.app.ActivityThread.handleSendResult(ActivityThread.java:4979) at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2044) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:224) at android.app.ActivityThread.main(ActivityThread.java:7562) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.os.Bundle android.content.Intent.getExtras()' on a null object reference at com.babanomania.pdfscanner.MainActivity.onActivityResult(MainActivity.java:345) at android.app.Activity.dispatchActivityResult(Activity.java:8249) at android.app.ActivityThread.deliverResults(ActivityThread.java:4931) at android.app.ActivityThread.handleSendResult(ActivityThread.java:4979)  at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2044)  at android.os.Handler.dispatchMessage(Handler.java:107)  at android.os.Looper.loop(Looper.java:224)  at android.app.ActivityThread.main(ActivityThread.java:7562)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)  2021-07-05 12:54:08.243 15090-15090/com.babanomania.pdfscanner I/Process: Sending signal. PID: 15090 SIG: 9

RabieMohimane avatar Jul 05 '21 12:07 RabieMohimane

Short update as I see there are still activity in this ticket. I'm now on LineageOS 18.1 (Android 11) and it looks like it work now, not sure if it's Android 11 that is better supported or if this was somehow corrected in an update.

ElucGeek avatar Jul 05 '21 12:07 ElucGeek