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

Not working on Android 14? #159

Open
eirinn1975 opened this issue Oct 10, 2023 · 72 comments
Open

Not working on Android 14? #159

eirinn1975 opened this issue Oct 10, 2023 · 72 comments

Comments

@eirinn1975
Copy link

The app stopped working after updating to Android 14. The splash screen appears for a fraction of second and then it closes. Is it just me?

@rdoeffinger
Copy link
Owner

I do not have an actual device running Android 14.
But it seems to work fine on the emulator.
I also see no crash reports that seem related on the Play Store side either.
I am working on an update to fully support Android 14. Those are just minor detail changes though, but maybe it would fix something.
In the mean time, the usual cleaning cache and data and/or reinstalling might be worth a try?

@eirinn1975
Copy link
Author

I've tried cleaning cache, purging the storage and reinstalling, but nothing worked.

@rdoeffinger
Copy link
Owner

rdoeffinger commented Oct 11, 2023

Are you able to get access to the logcat, or some other way to get a backtrace?
Or if you have the Play Store version to allow Google to send error reports?
I have one single crash report from Android 14 on a Pixel 7 Pro, but that seems to be something broken in Android's libicu and not the app itself...

@eirinn1975
Copy link
Author

eirinn1975 commented Oct 11, 2023 via email

@rdoeffinger
Copy link
Owner

You can also opt in to the 5.7.0 testing release to see if that helps.
I think the libicu thing was some OS level bug or data corruption, it was on the beta of Android 14, not final version.
So I think it's unlikely to be related to your issue, and I certainly have no idea what could be done about it (and not planning to try).

@eirinn1975
Copy link
Author

Reinstalled the app from the store. Both stable (5.6.3) and beta version (5.7.0) crash on startup. I've forwarded the collected data after crashes. Hopefully it will be useful.

@rdoeffinger
Copy link
Owner

Thanks for testing! Have not gotten the crash data yet, will check again tomorrow.

@eirinn1975
Copy link
Author

Just for info, I don't if it can help, but the exception class name seems to be java.lang.StackOverflowError:

Screenshot_20231012-183808

rdoeffinger added a commit that referenced this issue Oct 12, 2023
Might fix issue #159.
No root cause is known, but hopefully it is just a startup
race condition, so the transliterator will work if it gets
loaded later by the regular code.
@rdoeffinger
Copy link
Owner

Ah, useful, so it is indeed that ICU issue.
If lucky, it's some kind of startup race condition, I am adding a workaround, see patch linked above.

@rdoeffinger
Copy link
Owner

rdoeffinger commented Oct 12, 2023

Published a version with that workaround as beta (5.7.1). Please report if it changes anything (it might take a bit before it becomes available due to Google's review process, it's possible it will be available on F-droid first).

@eirinn1975
Copy link
Author

Thanks! I'll let you know as soon as it hits the f-droid or Google store.

@eirinn1975
Copy link
Author

Yes! It's working now 😊 thanks a lot!

@eirinn1975
Copy link
Author

Oh not so quick... After downloading a dictionary and selecting it, it went back to the same problem.

@rdoeffinger
Copy link
Owner

Yes, that will be when ICU is initialised when the other code fails.
Ok, that means it's indeed an ICU issue and it's not a race condition.
Unfortunately I am out of ideas for now.

@rdoeffinger
Copy link
Owner

Do you have the ability to experiment with your locale (e.g. app language) setting?
I just wonder if this maybe only happens in certain regions, and if that could be why I cannot reproduce it.

@eirinn1975
Copy link
Author

I could change it, yes, however my phone system language is set to English (United States). Any idea which language should I try?

@rdoeffinger
Copy link
Owner

Ok, that I should have tested, so it's probably not it. I guess you could try English (UK) or such, but maybe not worth messing with your phone settings since it's unlikely to help.
I tried having a look at the ICU code to see if I could limit the recursion somehow, but did not find any there either so far.

@eirinn1975
Copy link
Author

I've given UK English, Italian and Finnish a try, but all with the same result.

@RDusr05
Copy link

RDusr05 commented Dec 4, 2023

I have exactly the same problem with Android 14

You can't give the app any permissions to access the storage and thus the dictionaries. That's why the app probably always crashes as soon as it tries to access the dictionary.
Screenshot_20231204-205130_Einstellungen

@occivink
Copy link

As the only competent FOSS offline dictionary app, it's a shame that it won't run on android 14 at all. I can't contribute on the android development side, but I'd be happy to donate money for this bug to be fixed.

@rdoeffinger
Copy link
Owner

What you can do to help as a non-developer:

  • test non-Google Android 14 device. All the issue reports I have so far are on Google devices
  • try not convince Google to investigate this. Not very likely to work, but if there's evidence that non-Google Android 14 devices work fine, that might increase the chances.

I have no conclusive proof, but my best guess is that this is a bug in Android.
If I had access to an affected device, I might be able to come up with a workaround, but since the app would still not work 100% right, it's not worth a lot of effort.

@rdoeffinger
Copy link
Owner

I now have confirmation that the app works fine on a Samsung S22 running Android 14 (and previously confirmed that it works fine on emulator with Android 14), making it more likely that this is a Google issue.
At least it is not a general Android 14 incompatibility.

@bypear
Copy link

bypear commented Dec 19, 2023

Another affected user here. Using a Pixel 6, the issues happens with the stock OS and also with a 3rd party OS. There's no other translator app I would want to use. So, please don't let use hang with this issue. Pretty please. ;)

Besides, how can it be that it works on Samsung but not on pixels? If it really is an Android 14 specific bug, then I wonder that Samsung patched that bug out. My guess, somehow luckily it works with Samsung but probably more devices will come where it fails.

@rdoeffinger
Copy link
Owner

rdoeffinger commented Dec 19, 2023

So, please don't let use hang with this issue. Pretty please. ;)

It's not so simple. Right now I'm enjoying a mostly computer-free vacation.
But after that, either I can blindly try out workarounds and hope someone among you can test them for me.
Or I find someone with an affected device so I can experiment hands-on, which would probably speed it up a lot.
That option is a lot harder if only pixel devices are affected, thus my interest in reports of other devices with issues.

Besides, how can it be that it works on Samsung but not on pixels?

The Android emulator by Google also works fine.

then I wonder that Samsung patched that bug out.

More likely, the Google pixel team patched it in...

somehow luckily it works with Samsung but probably more devices will come where it fails.

That is also possible. And that would be useful information.

@atopia
Copy link

atopia commented Jan 17, 2024

I can confirm the issue (downloading and unpacking dictionaries works, but the app crashes as soon as a dictionary is selected) on a Fairphone 4 with CalyxOS 5.3.1, based on AOSP 14. If the Let me know if there is anything I can do to help debug the issue. The app worked great (thank you!) on Android 13 based CalyxOS and stopped working right with the update to Android 14. I would guess that the similarity to the affected Pixels is in the shared AOSP code base that somehow does not apply to Samsung's Android variant, but I unfortunately I don't have deeper knowledge of Android.

@rdoeffinger
Copy link
Owner

This is a pretty bad hack, but maybe someone can test if this version works around the issue?
I expect it will create some issues with word search, but it's a try
Dictionary-issue159-testing.zip

@eirinn1975
Copy link
Author

I've just tried the testing version. Unfortunately it doesn't solve the issue. If anything, now the app crashes whimsically at startup or after selecting the dictionary.

@eirinn1975 eirinn1975 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 18, 2024
@eirinn1975 eirinn1975 reopened this Jan 18, 2024
@BrilliantTrees
Copy link

I was directed here via my comment in #166

After installing the new APK provided above all appears to be working now.

Thanks @rdoeffinger

@somogyic
Copy link

Sorry, I know it's frustrating and it does not help you, but the app works 100% perfectly on all phones I have access to (I even asked friends to try), as well the Android emulator. I did have one more idea to try though, is someone wants to try the attached version if it changes anything... Dictionary-issue159-test2.zip

wfm too, thanks @rdoeffinger

@code-consensus
Copy link

code-consensus commented Aug 27, 2024

This solves the problem for me too!

The only thing I did notice with this test APK is that the app had some responsiveness issue -- though this may be because the file is not a release variant.

Specifically, if you press the flag icon at the top left to select a different dictionary, it takes about 5 seconds for the dictionary list to show up (on my phone -- Pixel 6 with Android v14) . But once you are presented with the list of dictionaries, pressing the flag of the dictionary you would like to switch to brings up the dictionary instantly.

In any case, this is a small price to pay for a functional app!

@rdoeffinger out of pure curiosity, given the app was working for the vast majority of phones, how did you find the problem and what did you change in the end?

Many thanks for this work!!

Sorry, I know it's frustrating and it does not help you, but the app works 100% perfectly on all phones I have access to (I even asked friends to try), as well the Android emulator. I did have one more idea to try though, is someone wants to try the attached version if it changes anything... Dictionary-issue159-test2.zip

@nutpantz
Copy link

nutpantz commented Aug 28, 2024

Pixel 8 pro Android 14.
This does not work for me.
There is no response at all, no error nothing
And the download lost for the files has no description so i have no idea which one is only English.

@rdoeffinger
Copy link
Owner

Short version: unfortunately this is a good hint, but not enough to do an acceptable fix, so I need you to do some more testing for me.
This one just updates the ICU version but still reduces its size. If it works, we're done. If it does not work, then it gets tricky and a lot more work... Please test.
Dictionary-issue159-test3.zip

More details:
Sorry for no response, I was travelling right after uploading this, and github's advanced security requirements for devs meant I was not able to respond.
I thought the crashingissue was with a system component, but I had completely forgotten that some time ago I replaced it with a custom copy.
What the test version does is update the version and package the full version instead of the stripped down version of ICU.
The latter part increases the app size a lot and probably causes performance issues (@code-consensus it is a release variant) .
As to the installation issue, this uses my signing key, which is compatible with app store releases, but F-Droid releases use their own key, that's likely why some of you had to uninstall first. Or it could be because I forgot to increase the version number...

@nutpantz
Copy link

Here is a log,i don't see it acts any different

1724946729.150 10329 29725 29725 D VRI[DictionaryManagerActivity]: visibilityChanged oldVisibility=false newVisibility=true
1724946729.181 10329 29725 29725 D AutofillManager: notifyViewReadyInner:1073741825
1724946729.214 10329 29725 29725 I ImeTracker: de.reimardoeffinger.quickdic:ae5f45fe: onRequestHide at ORIGIN_CLIENT_HIDE_SOFT_INPUT reason HIDE_SOFT_INPUT_FROM_VIEW
1724946729.215 10329 29725 29725 I ImeTracker: de.reimardoeffinger.quickdic:ae5f45fe: onFailed at PHASE_CLIENT_VIEW_SERVED
1724946729.215 10329 29725 29725 W InputMethodManager: Ignoring hideSoftInputFromView() as view=androidx.appcompat.widget.f{1b26963 VFED..C.. ......I. 0,0-0,0} is not served.
1724946729.218 10329 29725 29725 D VRI[DictionaryManagerActivity]: Start draw after previous draw not visible
1724946729.277 10329 29725 29725 I ImeTracker: de.reimardoeffinger.quickdic:da1c71c6: onRequestHide at ORIGIN_CLIENT_HIDE_SOFT_INPUT reason HIDE_SOFT_INPUT_FROM_VIEW
1724946729.277 10329 29725 29725 I ImeTracker: de.reimardoeffinger.quickdic:da1c71c6: onFailed at PHASE_CLIENT_VIEW_SERVED
1724946729.277 10329 29725 29725 W InputMethodManager: Ignoring hideSoftInputFromView() as view=androidx.appcompat.widget.f{de1f209 VFED..C.. ......I. 0,0-0,0} is not served.
1724946732.385 10329 29725 29725 D QuickDic: Downloading to: ES.quickdic.v007.zip
1724946732.516 10329 29725 29725 W QuickDic: Download started: ES.quickdic.v007.zip
1724946733.579 10329 29725 29725 D QuickDic: Downloading to: EN-AF.quickdic.v007.zip
1724946733.706 10329 29725 29725 W QuickDic: Download started: EN-AF.quickdic.v007.zip
1724946735.350 10329 29725 29725 D QuickDic: Downloading to: EN-grc.quickdic.v007.zip
1724946735.476 10329 29725 29725 W QuickDic: Download started: EN-grc.quickdic.v007.zip
1724946739.307 10329 29725 29725 D VRI[DictionaryManagerActivity]: visibilityChanged oldVisibility=true newVisibility=false
1724946739.328 10329 29725 29725 D VRI[DictionaryManagerActivity]: Not drawing due to not visible

@rdoeffinger
Copy link
Owner

@nutpantz I think your problem is a different one from the stack crash the others experienced (the other reports were crashes when opening a dictionary, not hangs or download list issues). I have no idea what the cause might be and if there is a way to avoid/fix it.

@nutpantz
Copy link

nutpantz commented Aug 29, 2024 via email

@code-consensus
Copy link

Hi @rdoeffinger , I tested your test3 version as requested.

This version also works. It doesn't crash on open, and it doesn't crash on loading a dictionary.

Please note, the performance issue I noted before is still there -- clicking the flag at the top left to change the dictionary takes several seconds to load the list of dictionaries.

However, I will also note that if instead of clicking the flag to switch dictionaries, you click the three dots at the top right and then "Dictionary manager", the list loads near instantly.

Short version: unfortunately this is a good hint, but not enough to do an acceptable fix, so I need you to do some more testing for me. This one just updates the ICU version but still reduces its size. If it works, we're done. If it does not work, then it gets tricky and a lot more work... Please test. Dictionary-issue159-test3.zip

More details: Sorry for no response, I was travelling right after uploading this, and github's advanced security requirements for devs meant I was not able to respond. I thought the crashingissue was with a system component, but I had completely forgotten that some time ago I replaced it with a custom copy. What the test version does is update the version and package the full version instead of the stripped down version of ICU. The latter part increases the app size a lot and probably causes performance issues (@code-consensus it is a release variant) . As to the installation issue, this uses my signing key, which is compatible with app store releases, but F-Droid releases use their own key, that's likely why some of you had to uninstall first. Or it could be because I forgot to increase the version number...

@G-i-o
Copy link

G-i-o commented Sep 5, 2024

@nutpantz I think your problem is a different one from the stack crash the others experienced (the other reports were crashes when opening a dictionary, not hangs or download list issues). I have no idea what the cause might be and if there is a way to avoid/fix it.

Yes, at least from my side, I can report that I've never had any issues about app hanging and other issues except the one reported here (app crashing on dictionary load), which was apparently fixed with the test version posted here.

rdoeffinger added a commit that referenced this issue Sep 5, 2024
Crashes only affected a limited number of devices,
but still relatively many and made the app completely unusable.
Fixes issue #159.
@rdoeffinger
Copy link
Owner

This version has been released to Google Play in the testing (beta) track.
I assume F-Droid will soon build and make it available as well (5.7.2 is the version).
I will give it a bit of time, check that it seems to fix things, release to main track on Google play.
Assuming no issues, I expect to close this ticket soon.
Issues that are not a crash to due a stack overflow issue will need their own ticket.
I am not sure the slow showing of dictionary list is a new issue or not, on my phone it's plenty fast, but on the emulator it is a bit slow. If I ever have some time over I might investigate a bit.

@rdoeffinger
Copy link
Owner

Btw in case you are also curious: there are around 4000 users that have the app installed on a device with Android 14.
But there are only about 6 crashes per month in the time since this issue appeared, so less than 100 crashes.
While this is the most serious issue the app had, with "only" 5% of users affected it's not trivial to investigate, and it would not have been possible without you helping me to test things!

@rdoeffinger
Copy link
Owner

Unfortunately I am still seeing the same crash with the newly released version for at least some users. Any ideas from anyone?

@thranur
Copy link

thranur commented Sep 7, 2024

Thank you very much for trying to fix this issue. I have been using Quickdic on my phones for years, and just got a Pixel 6 and it is crashing. I just tried the 5.7.2 APK from GitHub and it's still crashing after downloading a dictionary. Clearing cache does not help, I have to clear storage and then I can try to download a different dictionary. I tried a few but no changes. I can try using ADB to debug or something but I have never developed on Android.

Edit: sorry, I just connected my phone with ABD and used logcat, and I just realized it's exactly the same StackOverflow people have reported before. It's really annoying that only Google phones have this, it's likely something on their side. Anyway, my phone has almost nothing else on it, so I can try some wild changes on Android or even reinstall anything, in case that might help. I'll try messing around.

@thranur
Copy link

thranur commented Sep 7, 2024

Sorry if this is useless to you, but just in case, I managed to compile the latest git (v5.7.3) with Android Studio and run it in debug mode, and after downloading a dictionary and trying to open it, I still have the crash, and besides the stack overflow with no useful information (at n0.p.b0(SourceFile:224)), I also have:

2024-09-07 21:53:46.323 28154-28154 QuickDic                de.reimardoeffinger.quickdic.debug   D  onSearchTextChange: 
2024-09-07 21:53:46.324 28154-28154 QuickDic                de.reimardoeffinger.quickdic.debug   D  Hide soft keyboard.
2024-09-07 21:53:46.324 28154-28214 .quickdic.debug         de.reimardoeffinger.quickdic.debug   I  Rejecting re-init on previously-failed class java.lang.Class<com.ibm.icu.text.Transliterator>: java.lang.StackOverflowError: stack size 1038KB
                                                                                                    (Throwable with no stack trace)
2024-09-07 21:53:46.325 28154-28154 ImeTracker              de.reimardoeffinger.quickdic.debug   I  de.reimardoeffinger.quickdic.debug:44ef91cf: onRequestHide at ORIGIN_CLIENT_HIDE_SOFT_INPUT reason HIDE_SOFT_INPUT
2024-09-07 21:53:46.326 28154-28154 ImeTracker              de.reimardoeffinger.quickdic.debug   I  de.reimardoeffinger.quickdic.debug:44ef91cf: onFailed at PHASE_CLIENT_VIEW_SERVED
2024-09-07 21:53:46.326 28154-28154 ImeTracker              de.reimardoeffinger.quickdic.debug   I  de.reimardoeffinger.quickdic.debug:b2d6eb66: onRequestHide at ORIGIN_CLIENT_HIDE_SOFT_INPUT reason HIDE_SOFT_INPUT
2024-09-07 21:53:46.327 28154-28154 ImeTracker              de.reimardoeffinger.quickdic.debug   I  de.reimardoeffinger.quickdic.debug:b2d6eb66: onFailed at PHASE_CLIENT_VIEW_SERVED
2024-09-07 21:53:46.327 28154-28154 QuickDic                de.reimardoeffinger.quickdic.debug   D  Trying to restore searchText=
2024-09-07 21:53:46.328 28154-28154 QuickDic                de.reimardoeffinger.quickdic.debug   D  prefs changed: indexShortName
2024-09-07 21:53:46.328 28154-28154 QuickDic                de.reimardoeffinger.quickdic.debug   D  prefs changed: dictFile
FATAL EXCEPTION: Thread-3
  Process: de.reimardoeffinger.quickdic.debug, PID: 28154
  java.lang.NoClassDefFoundError: com.ibm.icu.text.Transliterator
  at com.hughes.android.dictionary.engine.TransliteratorManager.get(TransliteratorManager.java:45)
  at com.hughes.android.dictionary.engine.Index.normalizer(Index.java:108)
  at com.hughes.android.dictionary.engine.Index.getSortComparator(Index.java:119)
  at com.hughes.android.dictionary.engine.Index.findExact(Index.java:289)
  at com.hughes.android.dictionary.DictionaryActivity$5.run(DictionaryActivity.java:547)
  at java.lang.Thread.run(Thread.java:1012)
  Caused by: java.lang.StackOverflowError: stack size 1038KB

@rdoeffinger
Copy link
Owner

Before going too deep, is it right that neither test2 nor test3 versions of the app work for you?
More technical details:
It's not quite the right version of the source, but essentially you'd want to look at this code: https://android.googlesource.com/platform/external/icu/+/1537b2f/android_icu4j/src/main/java/android/icu/impl/ICUResourceBundle.java
Of particular interest would be the values of the variables in this block (line 1270):

                    if(openType == OpenType.LOCALE_DEFAULT_ROOT &&
                            !defaultLocale.getLanguage().equals(localeName)) {
                        b = (ICUResourceBundle)instantiateBundle(baseName, defaultID, root, openType);

What I think must be happening is that the language of the default locale never appears in its name, causing endless recursion and stack overflow.
Which is why the 5.7.3 patch tries changing the default locale to US on crash. But seems that does not help.

@thranur
Copy link

thranur commented Sep 7, 2024

Yes, I tried both 5.7.2 and 5.7.3, and they still crash. Using the debugger and adding a breakpoint at TransliteratorManager.java, line 45, result = Transliterator.createFromRules(..., I do get to the point in the comment mentioning "// This seems to happen with Android 14 on some Pixel 7 devices", but it seems to happen on Thread-2. Then Thread-3 comes along, I don't really understand what it does, and the application is suddenly terminated and I have the huge stack trace in logcat. So I don't understand if it's the "same" thread that tried again, or something else.

Sorry, I still need to better understand how to use Android Studio. For instance, I am now in UResourceBundle, and it says "Decompiled .class file, bytecode version: 50.0 (Java 6)". I tried clicking "Download" to get the source, but I got "Sources for 'icu4j-57.2.small.jar' not found". I see this line:

return getBundleInstance(baseName, localeName, ICUResourceBundle.ICU_DATA_CLASS_LOADER, false)

Where baseName is com/ibm/icu/impl/data/icudt57b/translit, localeName is root, and ICUResourceBundle.ICU_DATA_CLASS_LOADER is null.

After advancing some, I got to set a breakpoint at function instantiateBundle, at line b = (ICUResourceBundle)instantiateBundle(baseName, defaultID, root, openType);. I guess a screenshot will have much more detail than I can get, so here it is:

Screenshot_20240907_234503

So indeed it seems to be recursively calling itself over and over (the number of "hidden frames" increases when the breakpoint is hit).

@rdoeffinger
Copy link
Owner

rdoeffinger commented Sep 8, 2024

Yes, I tried both 5.7.2 and 5.7.3, and they still crash.

I meant the test2 and test3 zip files in this thread

but I got "Sources for 'icu4j-57.2.small.jar' not found".

The decompiled version seems good enough, but if you want the source you can switch to the full size version instead of small in build.gradle, there is a comment around mksmallicu command.
That also corresponds to the test2.zip I posted, it would be good to know if it happens to fix the issue (though I would prefer not having to include the full size ICU code).

I guess a screenshot will have much more detail than I can get, so here it is:

Can't really see what exactly defaultLocale is, but localeName = "keyTypeData" is clearly broken, so whatever calculates this goes wrong.

@thranur
Copy link

thranur commented Sep 8, 2024

Sorry about that, I missed those in the comments.

  • test2 works for me;
  • test3 crashes.

Concerning the build.gradle command, I saw this:

    // Note: you can just replace "smallicu" by implementation
    // and remove the "compile files" part if you do not
    // care about the size of the apk
    smallicu 'com.ibm.icu:icu4j:57.2'
    implementation files("$buildDir/icu4j-57.2.small.jar") {
        builtBy 'makesmallicu'
    }

By I didn't understand what "replace smallicu by implementation" means, neither where is the "compile files part".

Anyway, test2 seems to be working for me (possibly because I have a Pixel 6, not 7), so I guess I can stick with it for now. Thanks again for all the effort. Seeing how alien all of this is to me, I'm even more appreciative of how much effort people put into making and maintaining open-source Android apps.

@rdoeffinger
Copy link
Owner

Ok, based on your information I now published 5.7.4 which includes the full ICU package like test2.
I don't like that it doubles the size of the app without any real benefit besides avoiding this mysterious bug, but if it works I guess it's ok, it's still a fairly small app size.

@code-consensus
Copy link

I am not sure the slow showing of dictionary list is a new issue or not, on my phone it's plenty fast, but on the emulator it is a bit slow. If I ever have some time over I might investigate a bit.

Hi @rdoeffinger -- I tested the published v5.7.2 release. At least on my Pixel 6 with Android v14, the app worked without crashing upon loading!

However, I do get one additional issue though, which is that I now get an occasional pop-up of "Quickdic not responding" with the option to wait or close the app. The app meanwhile is still working fine if I press "wait", so it is not completely frozen or crashing, though the pop-up will come back frequently after that it seems unless I force close the app and restart. I do wonder if this is maybe related to the slow dictionary loading as I noticed it starting to happen after switching dictionaries.

Here is the the app-not-responding log thread:
process: de.reimardoeffinger.quickdic
activity: de.reimardoeffinger.quickdic/com.hughes.android.dictionary.DictionaryActivity
cause: ANR Input dispatching timed out (639973a Select dictionary… (server) is not responding. Waited 5000ms for FocusEvent(hasFocus=true)).
info: ANR in de.reimardoeffinger.quickdic (de.reimardoeffinger.quickdic/com.hughes.android.dictionary.DictionaryActivity)

N.B. I did not download the dictionaries from the internet, but rather had them already downloaded and changed the settings to point the app to the directory where they were stored. I also did not try to download any new dictionaries from the app either.

@hank-milliken
Copy link

hank-milliken commented Sep 14, 2024

I have GrapheneOS (Android 14) release 2024090400, and Pixel 7 Pro.

  • After upgrade to 5.7.2 the app started to work.
  • I started downloading couple of dictionaries
  • When I opened the Portuguese dictionaly it app crashed
  • Now crashes ever since
  • Clearing the cash does not help
  • Clearing storage helps

Here is the log I was able to get using: adb logcat | grep quickdic: quicdic-logcat.txt

@hank-milliken
Copy link

  • After that I downloaded English dictionary and opened it.
  • It crashed again

@rdoeffinger
Copy link
Owner

5.7.2 and 5.7.3 are still known broken. As mentioned above you need 5.7.4 for the real fix.

@code-consensus
Copy link

A bit by accident, I have found the source of problem.

I have tested this on v5.7.2 and the prior v5.7.1. I couldn't find the APK for v5.7.4 on github so I couldn't test that version (I checked releases/tag/v5.7.4 but there was just source-code and I don't have Android Studio).

@rdoeffinger mentioned above:

Which is why the 5.7.3 patch tries changing the default locale to US on crash. But seems that does not help.

In the the end, the issue is related to the locale -- but NOT the language!

As I mentioned in my posts above, test2, test3 and v5.7.2 all worked for me -- but what I did not take into account was that, since the last time I had posted in May, there was a fundamental change in my phone: I had done a factory reset.

What I discovered was that the test versions and v5.7.2 all worked for me, not because of any changes in those versions, but because of the factory reset. Because v5.7.1 now also works perfectly for me.

The problem is not the language -- I have tested it by using US English, German and Spanish -- all worked perfectly without any crashes.

*** Here is the problem: ***
The presence of "Regional preferences" causes the app to crash. That is the source of the problem -- if these are not set to "Use default", then the app will crash.

For example, go to System \ Languages and then to Regional preferences, then change Temperature and First day of the week to Celsius and Sunday. This will change your locale from e.g. en_US to en_US_#u-fw-sun-mu-celsius.

In summary: in both v5.7.1 and v5.7.2, if I have "Use default" Regional preferences, the app works perfectly. After I change the Regional preferences away from default, the app will only crash. Changing Regional preferences back to "Use default" then results in the app again behaving normally.

@rdoeffinger I hope that's helpful for you, and hopefully also allows you to be able to remove the full ICU package and decrease the app size again (as in test3 and v5.7.2).

@code-consensus
Copy link

code-consensus commented Sep 17, 2024

The only thing I did notice with this test APK is that the app had some responsiveness issue -- though this may be because the file is not a release variant.

FYI I discovered that the responsiveness issue with selecting the dictionary flag I mentioned above is not related to the changes in test2, test3 or v5.7.2 -- because I discovered this is also the case in the older v5.7.1.

What is nice about changing the dictionary by selecting the flag instead of three-dots/dictionary manager, is that it keeps the current word in the search field, so that you can instantly have the new dictionary you select search that term.

But for whatever reason I'm getting a responsiveness issue on this, it is clearly not related to the dictionary crashing.

@code-consensus
Copy link

Hi @rdoeffinger , I can confirm that my workaround posted above (using the smaller codebase of v5.7.2/5.7.1) also works under Android v15 as currently released in AP3A.241005.015.

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

No branches or pull requests