nextcloud / nextcloud/android

App crashes when opening any pdf

Open
#14,923 0 comments 0 reactions 0 assignees View on GitHub
0. Needs triage bug
Dominant language
Kotlin
Stars
5.6k
Forks
2k
Avg merge
2d 18h
Merged PRs (30d)
92

Description

### ⚠️ Before posting ⚠️

- [x] This is a **bug**, not a question or an enhancement.
- [x] I've [searched for similar issues](https://github.com/nextcloud/android/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](https://nextcloud.com/contribute/code-of-conduct/).

### Steps to reproduce

Open any pdf file then the app crashes but sometimes it shows the pdf after showing the error.

After re-opening the app, it shows a green tick on pdf then the app does not crashes when tapping on it

### Expected behaviour

Should open the pdf directly.

### Actual behaviour

Having an error log then opening the pdf & sometimes not opening the pdf only showing the error log

### Android version

15

### Device brand and model

Nothing CMF Phone 1

### Stock or custom OS?

Stock

### Nextcloud android app version

3.31.2

### Nextcloud server version

Nextcloud Hub 10 (31.0.4)

### Using a reverse proxy?

No

### Android logs

### Cause of error
```java
Exception in thread "Thread-54" java.lang.IllegalStateException: Fragment FileDetailActivitiesFragment{90a333a} (b53061c3-3a6c-47eb-b408-55d03e442f32) not attached to a context.
at androidx.fragment.app.Fragment.requireContext(Fragment.java:977)
at com.owncloud.android.ui.fragment.FileDetailActivitiesFragment.lambda$fetchAndSetData$6(FileDetailActivitiesFragment.java:335)
at com.owncloud.android.ui.fragment.FileDetailActivitiesFragment.$r8$lambda$fzpi7kO8PpXaUSSQob84vDVuOjs(Unknown Source:0)
at com.owncloud.android.ui.fragment.FileDetailActivitiesFragment$$ExternalSyntheticLambda5.run(D8$$SyntheticClass:0)
at java.lang.Thread.run(Thread.java:1012)

```

### App information
* ID: `com.nextcloud.client`
* Version: `30310290`
* Build flavor: `gplay`

### Device information
* Brand: `Nothing`
* Device: `Tetris`
* Model: `A015`
* Id: `AP3A.240905.015.A2`
* Product: `TetrisIND`

### Firmware
* SDK: `35`
* Release: `15`
* Incremental: `2504212015`

### Server error logs

```bash

```

### Additional information

_No response_

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.