cryptomator / cryptomator/android

Android: NullPointerException opening Nextcloud offline vault

Open
#611 0 comments 0 reactions 0 assignees View on GitHub
type:bug
Dominant language
Kotlin
Stars
1.2k
Forks
216
PR merge metrics
No merged PRs in 30d

Description

### Please agree to the following

- [x] I have searched [existing issues](https://github.com/cryptomator/android/issues?q=) for duplicates
- [x] I agree to follow this project's [Code of Conduct](https://github.com/cryptomator/android/blob/develop/.github/CODE_OF_CONDUCT.md)

### Summary

When trying to open an existing vault that resides in a Nextcloud-managed local folder marked as “Available offline,” the Android app accepts the password but immediately shows the generic error “Ein Fehler ist aufgetreten.” The logs consistently show a NullPointerException in `DocumentsContract.buildChildDocumentsUriUsingTree(...)`-

### System Setup

```markdown
- Android: android 16 / API36 using
- Cryptomator: v1.12.2 (3020) "Google Play Edition"
```

### Cloud Type

Local storage

### Steps to Reproduce

1) On Android, open Cryptomator 1.12.2.
2) Choose **Open existing vault** and navigate via the Android file picker to a **local** folder managed by the Nextcloud app that is marked **Available offline**.
3) Select the vault folder (the folder contains `masterkey.cryptomator` and `vault.cryptomator`).
4) Enter the correct vault password and confirm.
5) Cryptomator attempts to unlock and list the vault root.
6) Error “Ein Fehler ist aufgetreten.” occurs

### Expected Behavior

After entering the correct password, the vault should unlock and its root directory should be listed, allowing normal file browsing.

### Actual Behavior

After entering the password, Cryptomator shows the generic message **“Ein Fehler ist aufgetreten”** and fails to display the vault contents. The logs show an NPE in `DocumentsContract.buildChildDocumentsUriUsingTree(...)` within the Local/SAF content repository path. The issue reproduces reliably. Using the app’s WebDAV integration to open the **same** folder as a remote vault works **without errors**.

### Reproducibility

Always

### Relevant Log Output

```shell
ErrorCode: OGQC:CEV0
W 20251018102622.063 Message Ein Fehler ist aufgetreten

E 20251018102622.057 ExceptionHandler java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.net.Uri.getAuthority()' on a null object reference
at android.provider.DocumentsContract.buildChildDocumentsUriUsingTree(DocumentsContract.java:1067)
at org.cryptomator.data.cloud.local.LocalStorageAccessFrameworkImpl.list(LocalStorageAccessFrameworkImpl.kt:168)
at org.cryptomator.data.cloud.local.LocalStorageAccessFrameworkContentRepository.list(LocalStorageAccessFrameworkContentRepository.kt:54)
at org.cryptomator.data.repository.DispatchingCloudContentRepository.list(DispatchingCloudContentRepository.kt:103)
at org.cryptomator.data.cloud.crypto.CryptoImplVaultFormat7.list(CryptoImplVaultFormat7.kt:151)
...

I 20251018102347.953 App Cryptomator v1.12.2 (3020) "Google Play Edition" started on android 16 / API36 using a SM-S938B

(Repeats at 10:26:29, 10:38:46, 10:39:19, 10:40:52, 10:40:55, 10:52:39, 10:52:54 with the same stack and `OGQC:CEV0`.)
```

### Anything else?

- **Workaround:** Opening the same vault via **WebDAV** within Cryptomator works as expected (no errors), indicating the vault data is fine and the issue affects the Local/SAF access path (likely interaction with Nextcloud’s DocumentProvider when folder is set to “Available offline”).
- [Log.txt](https://github.com/user-attachments/files/22983544/0.txt)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.