rdoeffinger / Dictionary

"QuickDic" offline Dictionary App for Android. Provided downloadable dictionaries are based on Wiktionaries but can also be created from other sources (see DictionaryPC). Remember to use --recursive when cloning! Fork of project that used to be hosted at code.google.com/p/quickdic-dictionary.
Apache License 2.0
322 stars 69 forks source link

Not working on Android 14? #159

Open eirinn1975 opened 12 months ago

eirinn1975 commented 12 months ago

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 commented 12 months ago

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 commented 12 months ago

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

rdoeffinger commented 12 months ago

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 commented 12 months ago

Interesting, I'm on a pixel 7 (not pro). I removed the store version and installed it manually, but I will go back to the store version and allow error reports. Any fix for that libicu thingy?

--

Maximiliano Morsia

Hakamäentie 31, 26840 Rauma - Finland

tel. +358 (0) 40 175 1973<tel:+358401751973>


From: Reimar Döffinger @.> Sent: Wednesday, October 11, 2023 11:53:40 AM To: rdoeffinger/Dictionary @.> Cc: eirinn1975 @.>; Author @.> Subject: Re: [rdoeffinger/Dictionary] Not working on Android 14? (Issue #159)

Are you able to get access to the logical, 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...

— Reply to this email directly, view it on GitHubhttps://github.com/rdoeffinger/Dictionary/issues/159#issuecomment-1757177329, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AC2J23SRLZYGXII72ZNLPF3X6ZNA7ANCNFSM6AAAAAA52SBH2I. You are receiving this because you authored the thread.Message ID: @.***>

rdoeffinger commented 12 months ago

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 commented 12 months ago

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 commented 12 months ago

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

eirinn1975 commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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

eirinn1975 commented 11 months ago

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

eirinn1975 commented 11 months ago

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

rdoeffinger commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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

rdoeffinger commented 11 months ago

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 commented 11 months ago

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

RDusr05 commented 10 months ago

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 commented 9 months ago

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 commented 9 months ago

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

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 commented 9 months ago

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 commented 9 months ago

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 commented 9 months ago

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 commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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.

atopia commented 8 months ago

This is a pretty bad hack, but maybe someone can test if this version works around the issue?

I can confirm that this version still exhibits the same crashing behavior as the latest beta.

code-consensus commented 8 months ago

Hi @rdoeffinger , I have some additional information for you that perhaps may be helpful in debugging.

I am experiencing the same issue as the above users, but with one caveat -- the app actually works in certain instances.

FYI, my phone is a Pixel 6, running the latest Android v14 (UQ1A.240105.002) non-root, and I am using QuickDic v5.7.1 (F-droid variant).

My phone is set up as follows: -Owner profile: minimal profile with only a few apps -"main" secondary profile: this is my "daily driver" that includes the apps I normally use, and where QuickDic v5.6.3 was installed with Android v13, which worked fine until v14.

As the other commenters above, upgrading to Android v14 caused the same kind of crashing that has been mentioned. Upgrading QuickDic to v5.7.1 did not change anything. I have tried downloading dictionary files (which would then place them in the /data/ folder), or also setting a custom data folder with manually downloaded dictionaries -- in either scenario, once you select a dictionary, the app crashes as mentioned. I have tried clearing the app cache, clearing the app storage, uninstalling, re-installing, etc. -- always the same behaviour.

The potential difference is -- this only happens on the secondary profile where QuickDic had been installed prior to Android v14. The app works perfectly well as expected, either with downloading dictionaries, or using prior downloaded dictionaries in a custom folder: -on the owner profile -on another secondary profile with Google Play Services -on another secondary profile without Google Play Services

Therefore, it can't simply be a bug in Android v14, since the app is clearly working for my Pixel on the latest Android in the above instances. I don't know how to interpret this other than maybe one of the following problems:

  1. There is some "left-over" data in my "main" secondary profile that had QuickDic installed during Android v13, that even upon uninstalling, is left over and creates some conflict even when reinstalling QuickDic under Android v14.
  2. There is a specific system setting enabled that causes QuickDic to crash.
  3. QuickDic is crashing because of a conflict with some other app installed on the profile.

I hope this is helpful!

code-consensus commented 7 months ago

Hi, I have another minor detail that may also provide some insight into why the problem exists.

In my prior post above, I mentioned how in some user profiles on the same phone, the problem didn't exist. One thing I noticed in the "dysfunctional" user profile, was that after installation and program launch, there is no data directory "accessible" somehow.

Steps to reproduce:

  1. install Quickdic
  2. launch the program and adjust settings
  3. open the Files app, and go to /storage/emulated/{userID}/Android/data and no directory of "de.reimardoeffinger.quickdic" is shown to exist (though doing the same install on another user profile does show this folder created)
  4. launch app again and download a dictionary -- the app will show messages that a dictionary gets downloaded and installed, and then it will appear in the "dictionaries on device" list
  5. again, using the Files app, "de.reimardoeffinger.quickdic" somehow doesn't show up
  6. connect the phone to a computer for USB file transfer -- browsing to \Internal shared storage\Android\data and no "de.reimardoeffinger.quickdic" directory is shown

The app has clearly downloaded dictionary files and shows them being stored. So they must be there somehow, but maybe the fact that it is not visible is pointing to the problem.

Hopefully that gives some hint as to what is happening

maxmopp commented 7 months ago

Hi, I upgraded a POCOX3NFC (Surya) to crDroid 10.2 (A14), microG - I have the same Problem as above. Installing to amy "work profile" (Shelter) showed the same crash. I attach the logcat. quickdick.txt I hope you did not give up on that issue Thanks a lot

G-i-o commented 6 months ago

Same issue here. Worked fine until I upgraded to Lineage 21 (Android 14 based).

It crashes only after downloading the dictionaries. Changing the data folder has not solved it either.

Tested device: Google Pixel 3a.

Thank You.

basings commented 6 months ago

Same behavior as G-i-o on GrapheneOS A14, fdroid version

code-consensus commented 4 months ago

An update to my comment above, regarding the app working on certain profiles versus others -- this is no longer the case. The app no longer works at all in any profile for me, even with a brand new profile with nothing else installed.

I'm not sure what mitigating factor was involved before, and what changed with Android since my post, but this is the case as of at least the latest Pixel version (AP1A.240505.004) and perhaps an earlier update too.

altercat10n commented 1 month ago

This problem persists for almost a year. How do we resolve it?

(Is there another FLOSS offline dictionary app, preferably in F-Droid?)

rdoeffinger commented 1 month ago

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

eirinn1975 commented 1 month ago

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

I've tried to install this version, but my pixel with android 14 returns "you can't install the app on your device"

G-i-o commented 1 month ago

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

I've tried to install this version, but my pixel with android 14 returns "you can't install the app on your device"

You probably need to change permissions in the settings.

By default, Android does not let you install applicazions from sources other than Google Play.

G-i-o commented 1 month ago

I will try this as soons as I can. Thank You for working on it @rdoeffinger , whether it works or not. Will report.

Meanwhile, @altercat10n , there's another dictionary on F-Droid. It's called Aard2. It's only a simple dictionary, though (eg. no translator).

eirinn1975 commented 1 month ago

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

I've tried to install this version, but my pixel with android 14 returns "you can't install the app on your device"

You probably need to change permissions in the settings.

By default, Android does not let you install applicazions from sources other than Google Play.

Must be something else. I can install other apks just fine, but not this one.

G-i-o commented 1 month ago

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

I can confirm that this version works.

Thank You so much @rdoeffinger for your work! :pray:

G-i-o commented 1 month ago

@eirinn1975 , have you uninstalled the previous version? That is the other thing it may be happening as they cannot be installed together and they have a different signature, thus, your package manger won't update the other with this.

atopia commented 1 month ago

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

Works for me too. Amazing work, @rdoeffinger!

eirinn1975 commented 1 month ago

I had to remove the old version before installing the 159 test2 version. Update wasn't working. Installing the 159 test2 version from scratch seems to fix the issue. I can download and open dictionaries! Thanks!

altercat10n commented 1 month ago

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

Installed the app, downloaded dictionaries, searched for some words. This seems to work (GrapheneOS Stable (Android 14), Build 2024080600). Thank you!

BrilliantTrees commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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...