gsantner / markor

Text editor - Notes & ToDo (for Android) - Markdown, todo.txt, plaintext, math, ..
https://github.com/gsantner/markor/discussions/2269
Other
3.85k stars 369 forks source link

Markor crashes on startup on SailfishOS with Android AppSupport after allowing storage access #2424

Open ntninja opened 1 month ago

ntninja commented 1 month ago

⚠️ This issue respects the following points: ⚠️

Description

App crashes on startup, this is a regression in 2.12.5+. Version 2.12.4 and older do not exhibit this crash.

Steps to reproduce

  1. Install Markor / Mardor
  2. Complete tutorial
  3. Press “OK” in “Storage permission required to read and write files” dialog
  4. Press “Allow” in “Allow Markor to access photos and media on your device?” SFOS popup
  5. Swipe the “Allow access to manage all files” permission in opened Android settings
  6. Close Android settings
  7. Open Markor again

Information

Android version: 11 patch level 05/12/2023 (on SailfishOS 4.6.0.15) Device: Sony Xperia 10 II - Dual SIM App Version: 2.12.5

Firmware is SailfishOS, not Android-based, but includes an Android-based compatibility layer called “AppSupport“. If you think this is an issue with the Android environment, I can report it with them too, but they tend to be rather slow in updating due to lack of staff…

Source

F-Droid

Format / File type

Not specific

Additional info / Log

Log on Markor 2.12.5:

09-24 19:55:37.871    13    13 E cutils  : Failed to mkdirat(/mnt/media_rw/8ff87de4-0b37-4799-b09a-82773e869e07/Android): Read-only file system
09-24 19:55:37.873  9179  9179 W ContextImpl: Failed to ensure /storage/8ff87de4-0b37-4799-b09a-82773e869e07/Android/data/net.gsantner.markor/files: android.os.ServiceSpecificException:  (code -30)
09-24 19:55:37.855   175   376 I chatty  : uid=1000(system) AlienService identical 2 lines
09-24 19:55:37.857   175   376 E AlienService: Failed to set drag resizing mode
09-24 19:55:37.906   175   226 W ActivityTaskManager: resizeTask not allowed on task=Task{e9ca8b #4175 visible=true type=standard mode=fullscreen translucent=false A=10039:de.danoeh.antennapod U=0 StackId=4175 sz=1}
09-24 19:55:37.907   175   226 W ActivityTaskManager: resizeTask not allowed on task=Task{60bcaae #4185 visible=true type=standard mode=fullscreen translucent=false A=1000:com.android.settings U=0 StackId=4185 sz=2}
09-24 19:55:38.022    13    13 E cutils  : Failed to mkdirat(/mnt/media_rw/8ff87de4-0b37-4799-b09a-82773e869e07/Android): Read-only file system
09-24 19:55:38.023  9179  9247 W ContextImpl: Failed to ensure /storage/8ff87de4-0b37-4799-b09a-82773e869e07/Android/data/net.gsantner.markor/files: android.os.ServiceSpecificException:  (code -30)
09-24 19:55:38.198  9179  9247 E AndroidRuntime: FATAL EXCEPTION: pool-2-thread-1
09-24 19:55:38.198  9179  9247 E AndroidRuntime: Process: net.gsantner.markor, PID: 9179
09-24 19:55:38.198  9179  9247 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.io.File.getAbsolutePath()' on a null object reference
09-24 19:55:38.198  9179  9247 E AndroidRuntime:        at net.gsantner.opoc.frontend.filebrowser.GsFileBrowserListAdapter.lambda$loadFolder$9(Unknown Source:330)
09-24 19:55:38.198  9179  9247 E AndroidRuntime:        at net.gsantner.opoc.frontend.filebrowser.GsFileBrowserListAdapter.$r8$lambda$TWVJW-w70YRy2cjUS49nudys7G4(SourceFile:0)
09-24 19:55:38.198  9179  9247 E AndroidRuntime:        at net.gsantner.opoc.frontend.filebrowser.GsFileBrowserListAdapter$$ExternalSyntheticLambda1.run(SourceFile:0)
09-24 19:55:38.198  9179  9247 E AndroidRuntime:        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
09-24 19:55:38.198  9179  9247 E AndroidRuntime:        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
09-24 19:55:38.198  9179  9247 E AndroidRuntime:        at java.lang.Thread.run(Thread.java:923)
09-24 19:55:37.908   175   226 I chatty  : uid=1000(system) android.display identical 1 line
09-24 19:55:37.909   175   226 W ActivityTaskManager: resizeTask not allowed on task=Task{60bcaae #4185 visible=true type=standard mode=fullscreen translucent=false A=1000:com.android.settings U=0 StackId=4185 sz=2}
09-24 19:55:38.209   175  9252 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2
09-24 19:55:38.209   175   430 W ActivityTaskManager:   Force finishing activity net.gsantner.markor/.activity.MainActivity
09-24 19:55:38.259  9179  9247 I Process : Sending signal. PID: 9179 SIG: 9

Log on latest Nightly / Marder:

09-24 20:13:43.374    13    19 E cutils  : Failed to mkdirat(/mnt/media_rw/8ff87de4-0b37-4799-b09a-82773e869e07/Android): Read-only file system
09-24 20:13:43.375  9795  9795 W ContextImpl: Failed to ensure /storage/8ff87de4-0b37-4799-b09a-82773e869e07/Android/data/net.gsantner.markor_test/files: android.os.ServiceSpecificException:  (code -30)
09-24 20:13:43.465    13    19 E cutils  : Failed to mkdirat(/mnt/media_rw/8ff87de4-0b37-4799-b09a-82773e869e07/Android): Read-only file system
09-24 20:13:43.466  9795  9795 W ContextImpl: Failed to ensure /storage/8ff87de4-0b37-4799-b09a-82773e869e07/Android/data/net.gsantner.markor_test/files: android.os.ServiceSpecificException:  (code -30)
09-24 20:13:43.469  9795  9795 D AndroidRuntime: Shutting down VM
09-24 20:13:43.494  9795  9795 E AndroidRuntime: FATAL EXCEPTION: main
09-24 20:13:43.494  9795  9795 E AndroidRuntime: Process: net.gsantner.markor_test, PID: 9795
09-24 20:13:43.494  9795  9795 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.io.File.getName()' on a null object reference
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at net.gsantner.opoc.frontend.filebrowser.GsFileBrowserListAdapter.getVirtualFolders(GsFileBrowserListAdapter.java:154)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at net.gsantner.opoc.frontend.filebrowser.GsFileBrowserListAdapter.<init>(GsFileBrowserListAdapter.java:138)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at net.gsantner.opoc.frontend.filebrowser.GsFileBrowserFragment.onViewCreated(GsFileBrowserFragment.java:125)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at androidx.fragment.app.Fragment.performViewCreated(Fragment.java:2987)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:546)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2100)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at androidx.fragment.app.FragmentManager.execSingleAction(FragmentManager.java:1971)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at androidx.fragment.app.BackStackRecord.commitNow(BackStackRecord.java:305)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at androidx.viewpager2.adapter.FragmentStateAdapter.placeFragmentInViewHolder(FragmentStateAdapter.java:341)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at androidx.viewpager2.adapter.FragmentStateAdapter.onViewAttachedToWindow(FragmentStateAdapter.java:276)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at androidx.viewpager2.adapter.FragmentStateAdapter.onViewAttachedToWindow(FragmentStateAdapter.java:67)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at androidx.recyclerview.widget.RecyclerView.dispatchChildAttached(RecyclerView.java:7867)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at androidx.recyclerview.widget.RecyclerView$5.addView(RecyclerView.java:893)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at androidx.recyclerview.widget.ChildHelper.addView(ChildHelper.java:107)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at androidx.recyclerview.widget.RecyclerView$LayoutManager.addViewInt(RecyclerView.java:8902)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at androidx.recyclerview.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:8860)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at androidx.recyclerview.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:8848)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1645)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1591)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:668)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4309)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:4012)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4578)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at android.view.View.layout(View.java:22844)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at android.view.ViewGroup.layout(ViewGroup.java:6389)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at androidx.viewpager2.widget.ViewPager2.onLayout(ViewPager2.java:527)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at android.view.View.layout(View.java:22844)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at android.view.ViewGroup.layout(ViewGroup.java:6389)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at android.view.View.layout(View.java:22844)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at android.view.ViewGroup.layout(ViewGroup.java:6389)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at android.view.View.layout(View.java:22844)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at android.view.ViewGroup.layout(ViewGroup.java:6389)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at android.view.View.layout(View.java:22844)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at android.view.ViewGroup.layout(ViewGroup.java:6389)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at android.view.View.layout(View.java:22844)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at android.view.ViewGroup.layout(ViewGroup.java:6389)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at android.view.View.layout(View.java:22844)
09-24 20:13:43.494  9795  9795 E AndroidRuntime:        at android.view.ViewGroup.layout(ViewGroup.java:6389)
09-24 20:13:43.496  9795  9795 E AndroidRuntime:        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
09-24 20:13:43.496  9795  9795 E AndroidRuntime:        at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
09-24 20:13:43.496  9795  9795 E AndroidRuntime:        at com.android.internal.policy.DecorView.onLayout(DecorView.java:787)
09-24 20:13:43.496  9795  9795 E AndroidRuntime:        at android.view.View.layout(View.java:22844)
09-24 20:13:43.496  9795  9795 E AndroidRuntime:        at android.view.ViewGroup.layout(ViewGroup.java:6389)
09-24 20:13:43.496  9795  9795 E AndroidRuntime:        at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:3470)
09-24 20:13:43.496  9795  9795 E AndroidRuntime:        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2938)
09-24 20:13:43.496  9795  9795 E AndroidRuntime:        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1952)
09-24 20:13:43.496  9795  9795 E AndroidRuntime:        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8171)
09-24 20:13:43.496  9795  9795 E AndroidRuntime:        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:972)
09-24 20:13:43.496  9795  9795 E AndroidRuntime:        at android.view.Choreographer.doCallbacks(Choreographer.java:796)
09-24 20:13:43.496  9795  9795 E AndroidRuntime:        at android.view.Choreographer.doFrame(Choreographer.java:731)
09-24 20:13:43.496  9795  9795 E AndroidRuntime:        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957)
09-24 20:13:43.496  9795  9795 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:938)
09-24 20:13:43.496  9795  9795 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:99)
09-24 20:13:43.496  9795  9795 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:223)
09-24 20:13:43.496  9795  9795 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:7656)
09-24 20:13:43.496  9795  9795 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
09-24 20:13:43.496  9795  9795 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:599)
09-24 20:13:43.496  9795  9795 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
09-24 20:13:43.519   175  9870 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2
09-24 20:13:43.521   175  4044 W ActivityTaskManager:   Force finishing activity net.gsantner.markor_test/net.gsantner.markor.activity.MainActivity
09-24 20:13:43.647  9795  9795 I Process : Sending signal. PID: 9795 SIG: 9
09-24 20:13:43.647   175   223 W Looper  : Slow dispatch took 107ms android.fg h=com.android.server.DropBoxManagerService$DropBoxManagerBroadcastHandler c=null m=1
09-24 20:13:43.682  9057  9071 W System  : A resource failed to call release. 
09-24 20:13:43.747    41    41 I Zygote  : Process 9795 exited due to signal 9 (Killed)
gsantner commented 1 month ago

Sorry but honest said, don't own such a device, don't know anyone locally owning one either and assume you are one of thery few using it there.

Feel free to make fixes/improvements by merge request however.

ntninja commented 1 month ago

I see, any ideas given its a regression between 2.12.4 and 2.12.5?

gsantner commented 1 month ago

Maybe the nightly version from the Actions tab above works for you

ntninja commented 1 month ago

@gsantner: Thank you for your reply! I tried the android-apk from https://github.com/gsantner/markor/actions/runs/11023272817 and it crashes as like the other Mardor version I tried unfortunately.

ntninja commented 1 month ago

I also reported this to SFOS developers, but I doubt they’ll do anything about it unless I can pinpoint the exact issue here…

https://forum.sailfishos.org/t/markor-2-12-5-crashes-in-android-appsupport-while-2-12-4-worked/20145