itkach / aard2-android

Aard2 for Android, a simple dictionary app
GNU General Public License v3.0
426 stars 98 forks source link

aard2 crashes when tapping into search box #106

Closed ce-4 closed 4 years ago

ce-4 commented 4 years ago

Hello Mr Tkach,

I'd like to report two issues:

  1. UX improvement suggestion: When one clicks "search in page" in an article in Aard2 a search box appears but not the keyboard until the search bar is clicked. Could the search bar auto focus and automatically pop up the keyboard?

  2. Aard2 v0.43 search force closes with "java.lang.IllegalArgumentException: Search string shouldn't be null" on my mobile when the search box is clicked. Tried different EN/DE articles and Gboard, ASK and Simple keyboard, nor did reinstallation help. To reproduce: Hamburger menu, search, click into search inputbox=force close.

D/BlobDescriptorList(29656): Create descriptor from content url: http://127.0.0.1:8013/slob/c2d6918d-53e6-4b1d-9471-c1f37d8a1144/Lodi?blob=52166-19# 02-22 22:58:43.993 D/BlobDescriptorList(29656): Is bookmarked?false 02-22 22:58:43.993 D/ArticleWebView(29656): Auto style will return Vorgabe 02-22 22:58:43.993 D/ArticleWebView(29656): getPreferredStyle() will return Vorgabe 02-22 22:58:45.788 D/AndroidRuntime(29656): Shutting down VM 02-22 22:58:45.789 E/AndroidRuntime(29656): FATAL EXCEPTION: main 02-22 22:58:45.789 E/AndroidRuntime(29656): Process: itkach.aard2, PID: 29656 02-22 22:58:45.789 E/AndroidRuntime(29656): java.lang.IllegalArgumentException: Search string shouldn't be null 02-22 22:58:45.789 E/AndroidRuntime(29656): at com.android.webview.chromium.WebViewChromium.findAllAsync(PG:8) 02-22 22:58:45.789 E/AndroidRuntime(29656): at com.android.webview.chromium.WebViewChromium.findAll(PG:1) 02-22 22:58:45.789 E/AndroidRuntime(29656): at android.webkit.WebView.findAll(WebView.java:1802) 02-22 22:58:45.789 E/AndroidRuntime(29656): at android.webkit.FindActionModeCallback.findAll(FindActionModeCallback.java:149) 02-22 22:58:45.789 E/AndroidRuntime(29656): at android.webkit.FindActionModeCallback.findNext(FindActionModeCallback.java:124) 02-22 22:58:45.789 E/AndroidRuntime(29656): at android.webkit.FindActionModeCallback.onClick(FindActionModeCallback.java:194) 02-22 22:58:45.789 E/AndroidRuntime(29656): at android.view.View.performClick(View.java:6600) 02-22 22:58:45.789 E/AndroidRuntime(29656): at android.view.View.performClickInternal(View.java:6577) 02-22 22:58:45.789 E/AndroidRuntime(29656): at android.view.View.access$3100(View.java:781) 02-22 22:58:45.789 E/AndroidRuntime(29656): at android.view.View$PerformClick.run(View.java:25912) 02-22 22:58:45.789 E/AndroidRuntime(29656): at android.os.Handler.handleCallback(Handler.java:873) 02-22 22:58:45.789 E/AndroidRuntime(29656): at android.os.Handler.dispatchMessage(Handler.java:99) 02-22 22:58:45.789 E/AndroidRuntime(29656): at android.os.Looper.loop(Looper.java:193) 02-22 22:58:45.789 E/AndroidRuntime(29656): at android.app.ActivityThread.main(ActivityThread.java:6923) 02-22 22:58:45.789 E/AndroidRuntime(29656): at java.lang.reflect.Method.invoke(Native Method) 02-22 22:58:45.789 E/AndroidRuntime(29656): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 02-22 22:58:45.789 E/AndroidRuntime(29656): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:870) 02-22 22:58:46.864 I/Process (29656): Sending signal. PID: 29656 SIG: 9 02-22 22:58:47.047 I/ActivityManager(2048): Process itkach.aard2 (pid 29656) has died: fore

Device info: build.board: msm8953 build.brand: motorola build.cpu_abi: arm64-v8a build.fingerprint: motorola/ocean_reteu/ocean:9/PPOS29.114-134-7/d9234:user/release-keys build.manufacturer: motorola build.model: moto g(7) power build.product: ocean_reteu version.incremental: d9234 version.release: 9 version.sdk_int: 28

Thank you! kind regards Christian

francwalter commented 4 years ago

Interesting: I just tested it (especially the auto opening of the keyboard) and Aard2 crashes too, when I tap into the input field. So I can confirm the bug. Strange. Never had it before. Aard2 v0.43 on Xiaomi Mi A1 with Android 9.0 frank

itkach commented 4 years ago

Find-in-page dialog is part of Android, a built-in functionality of WebView, not my component.

Could the search bar auto focus and automatically pop up the keyboard?

This used to work. See #48.

Attempt to search with empty find box results in crash for me as well (Galaxy S9 with Android 9).

As you may have noticed, the error comes from Android code. Looks like Google entirely abandoned this component and just doesn't care that it's broken. Their position is unfortunate and completely misguided, but apparently not going to change any time soon, so the only way to make improvements would be to write a custom find dialog. I have no time or desire to work on this though.

francwalter commented 4 years ago

Thank for the answer!

On my phone, not only the attempt to search with empty search field crashes but already if I tap into the field to get the keyboard opened.

This is shame for Google. They didn't replace web view at all? Search in page is impossible so.

ce-4 commented 4 years ago

Let me correct my rather neutral tone in my initial report: I'd like to thank you for your work and the great app! Aard2 Dictionary is easily one of my most used and loved apps on my mobile (only second to FF and maybe OsmAnd). It's really incredible to have such vast information at hand offline without any tracking (apart from loading pictures from the web that can be switched off)! It's also a great tool to circumvent censorship of wikipedia in some countries.

Yes, I've seen that it creashes in the G component, and I was already afraid that it might be a showstopper if it needs bigger rework to fix (it broke with a phone firmware update or some webkit update a few weeks ago, now that I'm thinking about it - so definitely outside of the Aard2 app). I'm also aware that the app hasn't needed much maintenance in the past time and doesn't generate much revenue if at all.

With regards to the value that Aard2 has, is there any hope to get a fix in some way? I guess Bromite or GeckoView are probably out of scope / more hassle to implement. Would you accept a donation?

itkach commented 4 years ago

easily one of my most used and loved apps on my mobile

Thank you, great to hear!

if I tap into the field to get the keyboard opened.

@franc indeed, on a second look that's what happens for me as well. Looks like the only way it doesn't crash is if you copy text beforehand and then paste with menu that shows up on long tap. This is definitely a brand new regression. Head to https://play.google.com/store/apps/details?id=com.google.android.webview and give them one star 😈 ?

I guess Bromite or GeckoView are probably out of scope / more hassle to implement.

Indeed, that looks like a massive amount of work, both initially and maintaining it in the long run, plus would dramatically increase app size and introduce instability...

Would you accept a donation?

For monetary donations to add up to anything meaningful there has to be volume, which is not there for this app. People donating their time/efforts/computing resources, such as users compiling and hosting dictionaries (@MHBraun @franc and many others), are much more impactful and useful.

is there any hope to get a fix in some way?

If Google doesn't fix what they broke I guess I'll have to find the time to rewrite the find :(

MHBraun commented 4 years ago

Nor sure if it is of any help to y'all but Aard2 0.43 works still fine on my LG V20 with Android 8.0.0-- Sent from my Android phone with WEB.DE Mail. Please excuse my brevity.On 2/23/20, 10:39 itkach notifications@github.com wrote:

Find-in-page dialog is part of Android, a built-in functionality of WebView, not my component.

Could the search bar auto focus and automatically pop up the keyboard?

This used to work. See #48. Attempt to search with empty find box results in crash for me as well (Galaxy S9 with Android 9). As you may have noticed, the error comes from Android code. Looks like Google entirely abandoned this component and just doesn't care that it's broken. Their position is unfortunate and completely misguided, but apparently not going to change any time soon, so the only way to make improvements would be to write a custom find dialog. I have no time or desire to work on this though. —You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or unsubscribe.

ce-4 commented 4 years ago

Nor sure if it is of any help to y'all but Aard2 0.43 works still fine on my LG V20 with Android 8.0.0--

Yes, could very well be the case. I've upgraded my Moto G7 Power to 9 at some time in the past (however not sure when that was exactly and when I stumbled upon the issue in Aard2)

francwalter commented 4 years ago

...Looks like the only way it doesn't crash is if you copy text beforehand and then paste with menu that shows up on long tap.

I just tested this now (forgot about it) and indeed, that works! So as I rarely search in text and I know now a work-around it is good for me. I use a clipboard extender, the app Andclip, yes, real nerds have that ;) so I can easily edit my search if I have one. Thanks!

Silberpferd commented 4 years ago

"Aard2" is the most supportive, stable App that I use on my smartphone. The "search in page" functionality is a key feature I frequently use for academic research - say 3 to 10 times a week.

It‘s especially useful as the the "search-in-page" function of my browser with online-Wikipedias "mobile view" does not dig in unfolded passages.

I would donate for a fix as well.

Thanks for the hint of workaroud by copy/paste for the moment.