Open io7m opened 11 months ago
This is probably related to a bug we had with Webiew. A String resource id, required by WebView, should be made available to Android's Resources
when WebView loads for the first time. However, it's not available because TxNative
uses a wrapped Resources
object which points to an older AssetManager
which does not have the required resource id . We released a fix for this.
Do these crashes occur with TxNative 1.2.3 ?
Can you reproduce it consistently? If yes, can you provide with an STR for your app or send me a minimal reproducible example?
Ah, it looks like we're on 1.2.1
. I'll try upgrading and we'll see if it goes away in the next release. :+1:
Unfortunately, I don't have a consistent way to reproduce it; I've actually never even seen it happen. The only reason I know about it is because crashes are showing up in Crashlytics. If it's worth anything, the crashes we do see appear to be consistently happening only on Android 9. We don't exactly have a huge sample size, though.
The STR we found (and is included in the sample app) is showing an Activity with webview that has a selector: https://github.com/transifex/transifex-java/blob/devel/TransifexNativeSDK/app/src/main/assets/example.html
Do you have something similar in your app? Using a Txnative before 1.2.2
should crash in this scenario.
It's entirely possible that we do. Our app presents an interface to various public and academic libraries, and sometimes those libraries require logging in using SAML. This basically entails opening arbitrary web pages inside the app... Anything could be in there, really!
Another workaround, if possible for your app, is to avoid extending TxBaseAppCompatActivity
in the activities that use WebView.
This will disable TxNative functionality in these activities, but if all they do is show a WebView, you can do this.
Thanks! I'll be trying each of these suggestions. We won't be doing another app release until January as it's the holiday season, but we should find out pretty quickly if the problem has gone away.
I'll leave this ticket open for now, and I'll try to report back.
We just released a new version of the application yesterday, so hopefully we'll see if this has resolved things.
Note that TxNative 1.3.0 was released that improves the WebView related issue even further.
Looks like there was still one instance of the crash in our new release. I'm going to upgrade to 1.3.0
today. :+1:
Hello!
We've been using Transifex for a few months in our open-source Android app:
https://github.com/ThePalaceProject/android-core
We're seeing a few crashes in Crashlytics along these lines:
The obvious answer is that we're somehow missing a translated string somewhere, but even then... That shouldn't cause a crash, right? I'm at a bit of a loss as to how to track down exactly what's going wrong.
Is this a common occurrence with Transifex? Is there a bug here?