android icon indicating copy to clipboard operation
android copied to clipboard

PreviewText: open with leads to crash

Open ZetaTom opened this issue 2 years ago • 3 comments

⚠️ Before posting ⚠️

  • [X] This is a bug, not a question or an enhancement.
  • [X] I've searched for similar issues and didn't find a duplicate.
  • [X] I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
  • [X] I agree to follow Nextcloud's Code of Conduct.

Steps to reproduce

  1. set up nextcloud app with account
  2. create empty file.txt in root directory
  3. download file via three dots menu
  4. open file (local editor)
  5. open three dots menu located on top right-hand corner
  6. select Open with

Expected behaviour

Open with dialogue appears.

Actual behaviour

The app crashes. Sometimes the aforementioned dialogue does appear, on the home screen, after the app has crashed.

Android version

13

Device brand and model

OnePlus 6T

Stock or custom OS?

Custom (explain in "additional information")

Nextcloud android app version

849799c

Nextcloud server version

26.0.1

Using a reverse proxy?

No

Android logs

No response

Server error logs

No response

Additional information

Custom OS: LineageOS 20.0

ZetaTom avatar Jun 06 '23 16:06 ZetaTom

Can you provide the crash output (stack trace)?

joshtrichards avatar Oct 07 '23 22:10 joshtrichards

Can you provide the crash output (stack trace)?

I've just built the latest master (5701d29) and the behaviour has changed a bit. However, this may be due to running in an emulator (Android Studio, Pixel 2, API 30, AOSP). The app still crashes but, just before it does, it manages to open the text file in the HTML Viewer.

Logcat output
...
PreviewTextFragment     com.nextcloud.client                 E  onCreateView
PreviewTextFragment     com.nextcloud.client                 E  onStart
cache_test_DISK_        com.nextcloud.client                 D  image read from disk -924371482
FileActivity            com.nextcloud.client                 D  show loading dialog
PreviewTextFileFragment com.nextcloud.client                 E  onStop
OCFileListFragment      com.nextcloud.client                 I  onCreateView() start
OwnCloudClient #0       com.nextcloud.client                 D  REQUEST PROPFIND /remote.php/dav/files/alice/Empty%20file.txt
ExtendedListFragment    com.nextcloud.client                 D  onCreateView
OCFileListFragment      com.nextcloud.client                 I  onCreateView() end 
OCFileListFragment      com.nextcloud.client                 I  onActivityCreated() start
FileDataStorageManager  com.nextcloud.client                 D  Number of files updated with CONFLICT: 1
FileDataStorageManager  com.nextcloud.client                 D  checking parents to remove conflict; STARTING with /
FileDataStorageManager  com.nextcloud.client                 D  NO MORE conflicts in /
extcloud.clien          com.nextcloud.client                 I  Background young concurrent copying GC freed 185437(8045KB) AllocSpace objects, 23(460KB) LOS objects, 40% free, 11MB/19MB, paused 5.511ms total 119.954ms
extcloud.clien          com.nextcloud.client                 W  Reducing the number of considered missed Gc histogram windows from 106 to 100 
Compatibil...geReporter com.nextcloud.client                 D  Compat change id reported: 150939131; UID 10145; state: ENABLED
FileDataStorageManager  com.nextcloud.client                 D  checking parents to remove conflict; NEXT 
Synchroniz...eOperation com.nextcloud.client                 I  Synchronizing [email protected]:8080, file /Empty file.txt: Operation finished with HTTP status code -1 (success)
FileActivity            com.nextcloud.client                 D  dismiss loading dialog
FileDataStorageManager  com.nextcloud.client                 D  getFolderContent - start
FileDataStorageManager  com.nextcloud.client                 D  getFolderContent - finished
AndroidRuntime          com.nextcloud.client                 D  Shutting down VM
AndroidRuntime          com.nextcloud.client                 E  FATAL EXCEPTION: main
                                                                Process: com.nextcloud.client, PID: 22319
                                                                java.lang.IllegalStateException: Fragment FileActionsBottomSheet{9fb24ac} (a72ec547-9496-4ff2-ae18-93135b6ce269) not associated with a fragment manager.
                                                                        at androidx.fragment.app.Fragment.getParentFragmentManager(Fragment.java:1112)
                                                                        at com.nextcloud.ui.fileactions.FileActionsBottomSheet.dispatchActionClick(FileActionsBottomSheet.kt:310)
                                                                        at com.nextcloud.ui.fileactions.FileActionsBottomSheet.access$dispatchActionClick(FileActionsBottomSheet.kt:65)
                                                                        at com.nextcloud.ui.fileactions.FileActionsBottomSheet$onCreateView$2.invoke(FileActionsBottomSheet.kt:103)
                                                                        at com.nextcloud.ui.fileactions.FileActionsBottomSheet$onCreateView$2.invoke(FileActionsBottomSheet.kt:102)
                                                                        at com.nextcloud.ui.fileactions.FileActionsBottomSheet$sam$androidx_lifecycle_Observer$0.onChanged(Unknown Source:2)
                                                                        at androidx.lifecycle.LiveData.considerNotify(LiveData.java:133)
                                                                        at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:151)
                                                                        at androidx.lifecycle.LiveData.setValue(LiveData.java:309)
                                                                        at androidx.lifecycle.MutableLiveData.setValue(MutableLiveData.java:50)
                                                                        at com.nextcloud.ui.fileactions.FileActionsViewModel.onClick(FileActionsViewModel.kt:162)
                                                                        at com.nextcloud.ui.fileactions.FileActionsBottomSheet.inflateActionView$lambda$9$lambda$8(FileActionsBottomSheet.kt:292)
                                                                        at com.nextcloud.ui.fileactions.FileActionsBottomSheet.$r8$lambda$akwMQPy8SSZm7IZL9pPs1JnKp0Q(Unknown Source:0)
                                                                        at com.nextcloud.ui.fileactions.FileActionsBottomSheet$$ExternalSyntheticLambda0.onClick(Unknown Source:4)
                                                                        at android.view.View.performClick(View.java:7448)
                                                                        at android.view.View.performClickInternal(View.java:7425)
                                                                        at android.view.View.access$3600(View.java:810)
                                                                        at android.view.View$PerformClick.run(View.java:28305)
                                                                        at android.os.Handler.handleCallback(Handler.java:938)
                                                                        at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                        at android.os.Looper.loop(Looper.java:223)
                                                                        at android.app.ActivityThread.main(ActivityThread.java:7656)
                                                                        at java.lang.reflect.Method.invoke(Native Method)
                                                                        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Process                 com.nextcloud.client                 I  Sending signal. PID: 22621 SIG: 9
---------------------------- PROCESS ENDED (22621) for package com.nextcloud.client ----------------------------

ZetaTom avatar Oct 12 '23 07:10 ZetaTom

Similar prior reports:

  • #11529
  • #13030
  • #11749

joshtrichards avatar Jun 13 '24 13:06 joshtrichards

Similar code path: #11477

joshtrichards avatar Jul 09 '24 20:07 joshtrichards