Akylas / OSS-DocumentScanner

Android document document scanning app
https://www.akylas.fr
MIT License
722 stars 26 forks source link

Crash when deleting first scanned document #16

Closed cafehaine closed 8 months ago

cafehaine commented 9 months ago

Caught this when deleting my first scan before saving it.

Afterwards the app closes instantly when I try to open it.

FATAL EXCEPTION: main
Process: com.akylas.documentscanner, PID: 22200
com.tns.NativeScriptException: Calling js method onBindViewHolder failed
TypeError: Cannot read properties of undefined (reading 'id')
    at com.tns.Runtime.callJSMethodNative(Native Method)
    at com.tns.Runtime.dispatchCallJSMethodNative(SourceFile:1)
    at com.tns.Runtime.callJSMethodImpl(Unknown Source:100)
    at com.tns.Runtime.callJSMethod(SourceFile:1)
    at com.tns.Runtime.callJSMethod(SourceFile:2)
    at com.tns.Runtime.callJSMethod(SourceFile:3)
    at com.tns.gen.com.nativescript.collectionview.AdapterInterface.onBindViewHolder(Unknown Source:17)
    at com.nativescript.collectionview.Adapter.onBindViewHolder(SourceFile:2)
    at com.nativescript.collectionview.Adapter.onBindViewHolder(SourceFile:1)
    at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(SourceFile:1)
    at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(SourceFile:155)
    at androidx.recyclerview.widget.RecyclerView$Recycler.i(SourceFile:72)
    at androidx.recyclerview.widget.RecyclerView$Recycler.j(SourceFile:1142)
    at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(SourceFile:6)
    at androidx.recyclerview.widget.i0.b(SourceFile:54)
    at androidx.recyclerview.widget.GridLayoutManager.C(SourceFile:99)
    at androidx.recyclerview.widget.LinearLayoutManager.s(SourceFile:49)
    at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(SourceFile:748)
    at androidx.recyclerview.widget.GridLayoutManager.onLayoutChildren(SourceFile:45)
    at androidx.recyclerview.widget.RecyclerView.s(SourceFile:61)
    at androidx.recyclerview.widget.RecyclerView.q(SourceFile:72)
    at androidx.recyclerview.widget.RecyclerView.n(SourceFile:91)
    at androidx.activity.j.run(SourceFile:246)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1231)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1239)
    at android.view.Choreographer.doCallbacks(Choreographer.java:899)
    at android.view.Choreographer.doFrame(Choreographer.java:827)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1214)
    at android.os.Handler.handleCallback(Handler.java:942)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:201)
    at android.os.Looper.loop(Looper.java:288)
    at android.app.ActivityThread.main(ActivityThread.java:7924)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
farfromrefug commented 9 months ago

@cafehaine sorry for the issue. Can you clarify what you did?

cafehaine commented 9 months ago

Scan a document, then on the capture edit screen hit the delete button

farfromrefug commented 9 months ago

@cafehaine ok indeed i missed this one ! sorry yes it might break the app :( (you have a document without any page). You need to remove data from the app, is that ok with you?

cafehaine commented 9 months ago

That's fine with me, thanks :)

farfromrefug commented 9 months ago

@cafehaine a new build is up which should fix your issue https://github.com/Akylas/com.akylas.documentscanner/releases/tag/com.akylas.documentscanner%2Fandroid%2Fgithub%2F1.1.3%2F8

NA0341 commented 9 months ago

Hi there 🙋‍♂️

Same issue here. I installed the app from F-Droid (Neo Store), launched it, took a first photo - and pressed the delete - button on the capture UI.

What I tried: Delete Application data, delete data & reinstall (two times), update with your new version, then delete data & launch again.

But the behavior didn't change. As soon as I grant or deny the storage permission (which it asks for right after launch), it crashes instantly. But only after that.

Granting all permissions in advance didn't work either.

Again reinstalling the new version is also to no avail.


Maybe it has to do with my system:

Samsung Galaxy S8 (SM-G950F) OS version: 9 Bootloader: G950FXXUCDVG4, VM: ART Kernel: 4.4.111-21427293 Brand: samsung, Model: SM-G950F Board: universal8895, Manufacturer: samsung

SDK Target: 28, Min: 17

I debloated this device via adb shell "pm uninstall -k --user 0 <package_name> commands (as well as through AppManager through ADB over TCP mode - which should be the same thing) and removed almost everything related to both Samsung and Google - except needed system packages.

The device & (almost) all installed (F-Droid & GitHub) applications work like a charm and extremely fast. So for most that's not an issue. (And well it did work finde the very first time.) However, I don't know if your Application depends on something that's no longer there after the debloat. Obsidian doesn't even start for example - even though VebView is still in place (oh right maybe because it's not up to date 🧐).

I tested on a second S8 with the new version you just provided - and avoided the delete button.

I found some issues while testing on the second S8 and will make separate cards for them.

Here the screenshots:

Screenshot_20231217-142706_Settings Screenshot_20231217-142743_App Manager

So on my old Samsung S8 (which I didn't debloat) your application works like a charm (except #19 still present in 1.1.4.9). Can you tell me what I can do to find out the cause for this crash?

Ah and restart and wiping of the entire cache partition didn't help either - so it should be a missing software component or different configuration of some sort.

I mean both devices literally run the exact same kernel build as well - only the bootloader seems to be different (see #19).

Thank You in advance! :heart:

farfromrefug commented 9 months ago

@NA0341 sorry it still does not work. i will fix it. might also ensure it does not break the app on start

farfromrefug commented 9 months ago

@NA0341 there is on thing i dont understand. Your issue is that now the app crashes on start, even if you uninstall/install the app ? If so something is weird on your device. When you uninstall it should remove any app setting/data so the crash (which is due to a db thing the app does not like) should not happen again