nextcloud / nextcloud/android

java.lang.IllegalStateException: Two different ViewHolders have the same stable ID. Stable IDs in your adapter MUST BE unique and SHOULD NOT change.

Open
#14,739 2 comments 0 reactions 1 assignee Claimed by @alperozturk96 View on GitHub
bug feature: files performance: ISE/IAE :confused: stable-3.31
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

When deleting files from local system because of #14738 I guess I accidentally (due to that laggy ui) have clicked on "favorite" directory and then choose to delete it?

Then this happened?

### Expected behaviour

No crash

### Actual behaviour

### Cause of error
```java
Exception in thread "main" java.lang.IllegalStateException: Two different ViewHolders have the same stable ID. Stable IDs in your adapter MUST BE unique and SHOULD NOT change.
ViewHolder 1:OCFileListItemViewHolder{c2af077 position=1 id=20, oldPos=-1, pLpos:-1 not recyclable(1)}
View Holder 2:OCFileListItemViewHolder{de723fd position=0 id=20, oldPos=-1, pLpos:-1} com.owncloud.android.ui.EmptyRecyclerView{8526eaa VFED..... ......ID 0,0-1080,2193 #7f0a02c0 app:id/list_root}, adapter:com.owncloud.android.ui.adapter.OCFileListAdapter@611ac87, layout:androidx.recyclerview.widget.LinearLayoutManager@c9e1802, context:com.owncloud.android.ui.activity.FileDisplayActivity@fa15ef0
at androidx.recyclerview.widget.RecyclerView.handleMissingPreInfoForChangeError(RecyclerView.java:4778)
at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep3(RecyclerView.java:4702)
at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:4367)
at androidx.recyclerview.widget.RecyclerView.consumePendingUpdateOperations(RecyclerView.java:2095)
at androidx.recyclerview.widget.RecyclerView$1.run(RecyclerView.java:468)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1415)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1424)
at android.view.Choreographer.doCallbacks(Choreographer.java:1024)
at android.view.Choreographer.doFrame(Choreographer.java:949)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1398)
at android.os.Handler.handleCallback(Handler.java:991)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8787)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:591)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:871)

```

### App information
* ID: `com.nextcloud.client`
* Version: `30310090`
* Build flavor: `generic`

### Device information
* Brand: `Fairphone`
* Device: `FP4`
* Model: `FP4`
* Id: `AP4A.250205.002`
* Product: `FP4eea`

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

### Android version

Android 15

### Device brand and model

FP4

### Stock or custom OS?

Custom (explain in "additional information")

### Nextcloud android app version

3.31.0

### Nextcloud server version

31.0.0.18

### Using a reverse proxy?

Yes

### Android logs

_No response_

### Server error logs

```bash

```

### Additional information

CalyxOS 6.5.10

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.