syncthing / syncthing-android

Wrapper of syncthing for Android.
https://syncthing.net/
Mozilla Public License 2.0
3.47k stars 390 forks source link

When I try to select a folder on the device, the application crashes #1235

Open rakleed opened 6 years ago

rakleed commented 6 years ago

What happened

When I try to select a folder on the device, the application crashes

What you expected to happen instead

The opportunity to select a file manager will open (or immediately in a specific file manager) and I will be able to select the desired folder.

Any steps to reproduce the problem

  1. Go to the Folders section.
  2. Click on the "+" in the upper right corner.
  3. Click on "Directory".

Log and screenshot

Screenshot ![screenshot_20181023-151245_syncthing](https://user-images.githubusercontent.com/19418601/47359910-9a027d80-d6d6-11e8-9544-25a67305b7a9.png)

2018-10-23-15-14-46.txt

Version Information

App Version: 0.10.14 Syncthing Version: v0.14.50 Android Version: Android 8.1.0 / LineageOS 15.1 Device: OnePlus 3

AudriusButkevicius commented 6 years ago
-23 15:14:57.451 E/AndroidRuntime(14423): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.OPEN_DOCUMENT_TREE (has extras) }
10

Is the core of it.

It seems that you have no file manager that supports opening directories.

ruudschouten commented 5 years ago

I get the same exception, also on OnePlus 3, but I'm using OxygenOS 5.0.4

akiev commented 5 years ago

There was a similar problem. It turned out that this was due to the "frozen" stock file manager. AICP 13.1

adir-intsights commented 5 years ago

I have the same issue, not if I have a frozen stock file manager, can I install another compatible app?

akiev commented 5 years ago

adir-intsights, you mean other file managers? No, it did not help me then.

TheBauwssss commented 9 months ago

I just ran into this exact same issue on my rooted OnePlus 6 with OxygenOS version 10.3.6 (Android 10). Granted, in my case the offending application was Obsidian, but the error message I got was almost identical to the exception listed in your crash log:

Error Message Screenshot
Error: Failed to choose folder: No activity found to handle intent { act=android.intent.action.OPEN_DOCUMENT_TREE flg=0xc3 (has extras) }

How I Fixed It

To resolve the error I had to manually install the com.android.documentsui application, and I did so by following the steps detailed in this Android Stack Exchange answer: https://android.stackexchange.com/a/253276/404185

But, in case the above link ever goes down, here is the gist of the answer:

⚠️ Important: Remember to reboot your phone after executing either the ADB or terminal commands!

Option 1: Install the application using an ADB command

Open an ADB shell on your computer, connect your phone with USB-debugging enabled, and run the following command:

adb shell cmd package install-existing com.android.documentsui

(If you don't know how to use Android Debug Bridge commands, here is a guide: https://www.howtogeek.com/125769/how-to-install-and-use-abd-the-android-debug-bridge-utility/)

Option 2: Install the application via a terminal emulator on your phone

If you have root, you can open a terminal emulator on your phone (just search the Play store for 'terminal emulator') and execute the following two commands, one after the other:

su
cmd package install-existing com.android.documentsui


I chose the second option, and it worked like a charm for me!

ayush19283 commented 6 months ago

@TheBauwssss is it safe to run the command adb shell cmd package install-existing com.android.documentsui

i hope it will not cause any harm to device

ayush19283 commented 6 months ago

@Catfriend1 is the issue android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.OPEN_DOCUMENT_TREE flg=0x1 } still pending or have you fixed it?