Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash on search #1876

Closed
paskalito opened this issue Aug 18, 2023 · 12 comments
Closed

crash on search #1876

paskalito opened this issue Aug 18, 2023 · 12 comments
Labels

Comments

@paskalito
Copy link

Please use GitHub reactions 👍 to show that you are affected by the same issue. Please don't comment if you have no relevant information to add!

Describe the bug

app crashes immedeatly when typing "n" in search bar

also happens sometimes with other querys (not reliably)

To Reproduce
Steps to reproduce the behavior:

  1. Go to searchbar
  2. Type "n"
  3. See error/crash

Expected behavior

search

Screenshots

Smartphone (please complete the following information):

  • Nextcloud Notes-Version (android app): 4.1.0 rc 1
  • F-Droid or Play Store: fdroid
  • Android-Version: 13
  • Device: oneplus6

Server

  • Nextcloud version: 25.06
  • Nextcloud Notes version (server app): 4.7.2

Stacktrace

App Version: 4.1.0 RC1
App Version Code: 40010051
App Flavor: fdroid

Files App Version Code: 30250090 (PROD)

---

OS Version: 4.9.337-g268f05c68b0b(702d9e164a)
OS API Level: 33
Device: OnePlus6
Manufacturer: OnePlus
Model (and Product): ONEPLUS A6003 (OnePlus6)

---

java.lang.IndexOutOfBoundsException: setSpan (88 ... 79) has end before start
	at android.text.SpannableStringInternal.checkRange(SpannableStringInternal.java:485)
	at android.text.SpannableStringInternal.setSpan(SpannableStringInternal.java:199)
	at android.text.SpannableStringInternal.setSpan(SpannableStringInternal.java:186)
	at android.text.SpannableString.setSpan(SpannableString.java:60)
	at com.nextcloud.android.common.ui.theme.utils.AndroidViewThemeUtils.spanText(AndroidViewThemeUtils.kt:584)
	at com.nextcloud.android.common.ui.theme.utils.AndroidViewThemeUtils.highlightText(AndroidViewThemeUtils.kt:562)
	at com.nextcloud.android.common.ui.theme.utils.AndroidViewThemeUtils.access$highlightText(AndroidViewThemeUtils.kt:75)
	at com.nextcloud.android.common.ui.theme.utils.AndroidViewThemeUtils$highlightText$1.invoke(AndroidViewThemeUtils.kt:548)
	at com.nextcloud.android.common.ui.theme.utils.AndroidViewThemeUtils$highlightText$1.invoke(AndroidViewThemeUtils.kt:547)
	at com.nextcloud.android.common.ui.theme.ViewThemeUtilsBase.withScheme(ViewThemeUtilsBase.kt:49)
	at com.nextcloud.android.common.ui.theme.utils.AndroidViewThemeUtils.highlightText(AndroidViewThemeUtils.kt:547)
	at com.nextcloud.android.common.ui.theme.utils.AndroidViewThemeUtils.highlightText$default(AndroidViewThemeUtils.kt:541)
	at com.nextcloud.android.common.ui.theme.utils.AndroidViewThemeUtils.highlightText(Unknown Source:23)
	at it.niedermann.owncloud.notes.main.items.NoteViewHolder.bindSearchableContent(NoteViewHolder.java:98)
	at it.niedermann.owncloud.notes.main.items.list.NoteViewHolderWithExcerpt.bind(NoteViewHolderWithExcerpt.java:41)
	at it.niedermann.owncloud.notes.main.items.ItemAdapter.onBindViewHolder(ItemAdapter.java:154)
	at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:7678)
	at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:7761)
	at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:6582)
	at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6848)
	at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6688)
	at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6684)
	at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2362)
	at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1662)
	at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1622)
	at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:687)
	at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4604)
	at androidx.recyclerview.widget.RecyclerView.onMeasure(RecyclerView.java:3981)
	at android.view.View.measure(View.java:26380)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6981)
	at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
	at android.view.View.measure(View.java:26380)
	at androidx.swiperefreshlayout.widget.SwipeRefreshLayout.onMeasure(SwipeRefreshLayout.java:705)
	at android.view.View.measure(View.java:26380)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6981)
	at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1608)
	at android.widget.LinearLayout.measureVertical(LinearLayout.java:878)
	at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
	at android.view.View.measure(View.java:26380)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6981)
	at androidx.coordinatorlayout.widget.CoordinatorLayout.onMeasureChild(CoordinatorLayout.java:760)
	at androidx.coordinatorlayout.widget.CoordinatorLayout.onMeasure(CoordinatorLayout.java:833)
	at android.view.View.measure(View.java:26380)
	at androidx.drawerlayout.widget.DrawerLayout.onMeasure(DrawerLayout.java:1156)
	at android.view.View.measure(View.java:26380)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6981)
	at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
	at androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:145)
	at android.view.View.measure(View.java:26380)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6981)
	at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
	at android.view.View.measure(View.java:26380)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6981)
	at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
	at android.view.View.measure(View.java:26380)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6981)
	at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1608)
	at android.widget.LinearLayout.measureVertical(LinearLayout.java:878)
	at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
	at android.view.View.measure(View.java:26380)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6981)
	at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
	at com.android.internal.policy.DecorView.onMeasure(DecorView.java:760)
	at android.view.View.measure(View.java:26380)
	at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:4021)
	at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:2637)
	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2943)
	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2350)
	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9194)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1231)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1239)
	at android.view.Choreographer.doCallbacks(Choreographer.java:899)
	at android.view.Choreographer.doFrame(Choreographer.java:832)
	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1214)
	at android.os.Handler.handleCallback(Handler.java:942)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.app.ActivityThread.main(ActivityThread.java:7884)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

@paskalito paskalito added the bug label Aug 18, 2023
@paskalito
Copy link
Author

Presists with nc notes app 4.8.1

@onelazyuser
Copy link

I can confirm this issue.

App Version: 4.1.0 RC1
App Version Code: 40010051
App Flavor: fdroid

Files App Version Code: 30250090 (PROD)

---

OS Version: 5.10.157-android13-4-00003-g776d0a76f6aa-ab10208116(10316531)
OS API Level: 33
Device: raven
Manufacturer: Google
Model (and Product): Pixel 6 Pro (raven)

---

java.lang.IndexOutOfBoundsException: setSpan (49 ... 20) has end before start
	at android.text.SpannableStringInternal.checkRange(SpannableStringInternal.java:485)
	at android.text.SpannableStringInternal.setSpan(SpannableStringInternal.java:199)
	at android.text.SpannableStringInternal.setSpan(SpannableStringInternal.java:186)
	at android.text.SpannableString.setSpan(SpannableString.java:60)
	at com.nextcloud.android.common.ui.theme.utils.AndroidViewThemeUtils.spanText(AndroidViewThemeUtils.kt:584)
	at com.nextcloud.android.common.ui.theme.utils.AndroidViewThemeUtils.highlightText(AndroidViewThemeUtils.kt:562)
	at com.nextcloud.android.common.ui.theme.utils.AndroidViewThemeUtils.access$highlightText(AndroidViewThemeUtils.kt:75)
	at com.nextcloud.android.common.ui.theme.utils.AndroidViewThemeUtils$highlightText$1.invoke(AndroidViewThemeUtils.kt:548)
	at com.nextcloud.android.common.ui.theme.utils.AndroidViewThemeUtils$highlightText$1.invoke(AndroidViewThemeUtils.kt:547)
	at com.nextcloud.android.common.ui.theme.ViewThemeUtilsBase.withScheme(ViewThemeUtilsBase.kt:49)
	at com.nextcloud.android.common.ui.theme.utils.AndroidViewThemeUtils.highlightText(AndroidViewThemeUtils.kt:547)
	at com.nextcloud.android.common.ui.theme.utils.AndroidViewThemeUtils.highlightText$default(AndroidViewThemeUtils.kt:541)
	at com.nextcloud.android.common.ui.theme.utils.AndroidViewThemeUtils.highlightText(Unknown Source:23)
	at it.niedermann.owncloud.notes.main.items.NoteViewHolder.bindSearchableContent(NoteViewHolder.java:98)
	at it.niedermann.owncloud.notes.main.items.list.NoteViewHolderWithExcerpt.bind(NoteViewHolderWithExcerpt.java:41)
	at it.niedermann.owncloud.notes.main.items.ItemAdapter.onBindViewHolder(ItemAdapter.java:154)
	at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:7678)
	at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:7761)
	at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:6582)
	at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6848)
	at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6688)
	at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6684)
	at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2362)
	at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1662)
	at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1622)
	at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:687)
	at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4604)
	at androidx.recyclerview.widget.RecyclerView.onMeasure(RecyclerView.java:3981)
	at android.view.View.measure(View.java:26496)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6981)
	at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
	at android.view.View.measure(View.java:26496)
	at androidx.swiperefreshlayout.widget.SwipeRefreshLayout.onMeasure(SwipeRefreshLayout.java:705)
	at android.view.View.measure(View.java:26496)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6981)
	at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1608)
	at android.widget.LinearLayout.measureVertical(LinearLayout.java:878)
	at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
	at android.view.View.measure(View.java:26496)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6981)
	at androidx.coordinatorlayout.widget.CoordinatorLayout.onMeasureChild(CoordinatorLayout.java:760)
	at androidx.coordinatorlayout.widget.CoordinatorLayout.onMeasure(CoordinatorLayout.java:833)
	at android.view.View.measure(View.java:26496)
	at androidx.drawerlayout.widget.DrawerLayout.onMeasure(DrawerLayout.java:1156)
	at android.view.View.measure(View.java:26496)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6981)
	at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
	at androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:145)
	at android.view.View.measure(View.java:26496)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6981)
	at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
	at android.view.View.measure(View.java:26496)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6981)
	at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
	at android.view.View.measure(View.java:26496)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6981)
	at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1608)
	at android.widget.LinearLayout.measureVertical(LinearLayout.java:878)
	at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
	at android.view.View.measure(View.java:26496)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6981)
	at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
	at com.android.internal.policy.DecorView.onMeasure(DecorView.java:760)
	at android.view.View.measure(View.java:26496)
	at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:4042)
	at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:2658)
	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2964)
	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2371)
	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9297)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1231)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1239)
	at android.view.Choreographer.doCallbacks(Choreographer.java:899)
	at android.view.Choreographer.doFrame(Choreographer.java:832)
	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1214)
	at android.os.Handler.handleCallback(Handler.java:942)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.app.ActivityThread.main(ActivityThread.java:7918)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

@stefan-niedermann
Copy link
Member

this issue has been fixed and is waiting for its release, please be a bit more patient.

@DamienMutiDesgrouas

This comment was marked as duplicate.

@pcrockett
Copy link

pcrockett commented Sep 11, 2023

Thanks for the quick fix, especially on a spare-time project.

For what it's worth, it looks like F-Droid can't tell the difference between release candidates and stable releases, so the default install on F-Droid will be the unstable version.

I could be wrong about this; I'm actually using Aurora Droid, so maybe the official F-Droid app behaves differently. In any case, Aurora Droid marks the release candidate as the "suggested" version.

I tried downgrading to 4.0.0, but that failed with a corrupt APK error 😦

@meyou69
Copy link

meyou69 commented Sep 12, 2023

Hello,

Sorry to bump this issue out of nowhere, but can I please request for a deployment of this bugfix?

It's been more than 2 months since the last time this app got updated on F-Droid and I really would need this fix installed, particularly because I rely on the search feature a lot and every time I type in even a single character into the search box, the app immediately crashes with this error. It's seriously impacting my day to day life, since I rely on these notes a lot.

Thank you

@paskalito
Copy link
Author

@meyou69 @pcrockett

Hotfix

You CAN downgrade by. Uninstalling first (Often the case with anddroid apps btw) > then install 4.0 (is what i use) does not have this issue.
You will need to reimport all of your notes. - so make sure you have successfully synced before.
It will take some time, to downlaod all the notes again, but its way better than not really able to use notes.

Unstable Versions.

I use regular fdroid and also got "autoupdated" to the rc - which is not what i want - i ignored updates for the app for now.

Fdroid can have betaversions which are not marked as recommended (was the case with fdroid itself f.e.) - sadly i could not find very usable informatoin on how to mark something as beta.
but i believe here
https://gitlab.com/fdroid/fdroiddata/-/blob/master/metadata/it.niedermann.owncloud.notes.yml#L980
is determined what the currend/reccomended software is.
I dont now how it gets there tough..

@meyou69
Copy link

meyou69 commented Sep 12, 2023

Oh cool.

I didn't know 4.0 didn't have the issue.

Thanks! I downgraded it right now and I can confirm that the search works again. This is gonna save me a lot of headaches until the fix comes out.

Thank you!

@paskalito
Copy link
Author

Update on Fdroid Versioning

I found actual information.

https://f-droid.org/de/docs/Build_Metadata_Reference/#CurrentVersion
Seems like i suspected

https://f-droid.org/de/docs/Build_Metadata_Reference/#UpdateCheckMode
might be of interest too.
Too me Tags with the Regex Option seems to be the way to handle all of this automagically.

@thgoebel
Copy link
Contributor

FYI I made a MR for F-Droid to (1) only auto-update to stable tags and (2) not suggest 4.1.0 RC1 as an update any longer.

@paskalito
Copy link
Author

FYI I made a MR for F-Droid to (1) only auto-update to stable tags and (2) not suggest 4.1.0 RC1 as an update any longer.

Amazing, thank you!

@plaes
Copy link

plaes commented Oct 11, 2023

Seems like 4.1.0 has been published, so this issue could be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants