AndBible / and-bible

AndBible: Bible Study
https://andbible.org
GNU General Public License v3.0
577 stars 193 forks source link

Crash in Search: ClassCastException SwordDictionary as SwordBook #3189

Closed tuomas2 closed 1 week ago

tuomas2 commented 7 months ago

Trying to get Strongs numbers cross references within text.

https://support.andbible.org/scp/tickets.php?id=2632 https://support.andbible.org/scp/tickets.php?id=2432

Device info:
App id: net.bible.android.activity
Version: 5.0.794#c119a7cc9 googleplay standard release (built 18/01/24 19:15:48)
Android version: 14
Android SDK version: 34
Manufacturer: samsung
Model: SM-A336B
Storage Mb free: 51977
WebView version: 120.0.6099.231
SQLITE version: 3.42.0
Used heap memory in Mb: 57
Max heap memory in Mb: 256

Exception:
java.lang.RuntimeException: Unable to start activity ComponentInfo{net.bible.android.activity/net.bible.android.view.activity.search.Search}: java.lang.ClassCastException: org.crosswire.jsword.book.sword.SwordDictionary cannot be cast to org.crosswire.jsword.book.sword.SwordBook
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4164)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4322)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2685)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:230)
at android.os.Looper.loop(Looper.java:319)
at android.app.ActivityThread.main(ActivityThread.java:8893)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
Caused by: java.lang.ClassCastException: org.crosswire.jsword.book.sword.SwordDictionary cannot be cast to org.crosswire.jsword.book.sword.SwordBook
at net.bible.android.view.activity.search.Search.getDocumentToSearch(Search.kt:67)
at net.bible.android.view.activity.search.Search.onCreate(Search.kt:112)
at android.app.Activity.performCreate(Activity.java:8944)
at android.app.Activity.performCreate(Activity.java:8913)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1456)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4146)
... 12 more
tuomas2 commented 6 months ago

also https://support.andbible.org/scp/tickets.php?id=2512

tuomas2 commented 3 months ago

https://support.andbible.org/scp/tickets.php?id=2608

tuomas2 commented 2 weeks ago

Some more heat: https://support.andbible.org/scp/tickets.php?id=2688

tuomas2 commented 2 weeks ago

LinkControl (Searching strong:h03069 in ABP, i.e. "Search all occurrenses") (needIndex: no) -> SearchResults -> fetchSearchResults -> SearchIndex.

It comes this way to SearchIndex and indexes (or tries to) dictionary, which is not implemented (properly) and then searching crashes.

tuomas2 commented 1 week ago

If I remove module that was used earlier as bible in links document, it gives window "Create index for null?" - but it does not go there this way (it goes directly from LinkControl)