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
Voice NDK crashes Java_com_twilio_voice_JniUtils_nativeJavaUtf16StringToStdString #572
Comments
@paco-spr Thanks for the report, do you have by any chance, any knowledge if this is only happening on 32 bit devices or builds? (I ask because of the call to software division, |
Sorry for the delay in getting back to you. It looks like firebase lists a couple different variants for this issue. The variant containing the __udivdi3 call happens significantly less than this variant:
However, I've checked both variants, and they both seem to happen on 64 bit devices such as Galaxy A13, Redmi A1+, Galaxy S22 Ultra. |
Hi @afalls-twilio , any update around this? Looking at all our error logs we are seeing around 3k crashes per month around the native voice library. Below I'm pasting the most common traces that we are seeing:
Any recommendation or tip as to how to avoid them or fix them (on our end if possible) would be much appreciated it. |
jamesbluecrow what is your build setup? or how is the application installed on the user's system? is it a preloaded app, or are their other versions twilio voice somehow on the same application folder? The other thing, have you been able to reproduce this with the quickstart? Is your application exposing this C API (Java_com_twilio_voice_JniUtils_nativeJavaUtf16StringToStdString)? It is a JNI binding method that the JVM will bind to the java class com.twilio.voice.JniUtils which does not exist as of the 6.3.2 (the stated release) release. So unless it was exposed some other way, its not exposed to the JAVA layer and is not linked/bound to any java class... its dead legacy code (not called by anyone). |
The users are installing the app thorough google play. It is not a preloaded app and there is no other versions of twilio voice: We have this in our gradle (copied from the quickstart):
I haven't been able to reproduce this, neither with the quickstart, or in our app in debug or even in our release, but we are definitely seeing some users affected by this, we have around 3k crashes monthly coming from the native Twilio SDK. We only started noticing this when we enabled crashlytics ndk reports so they were likely happening before but we hadn't noticed. We are seeing this happening in different versions of Android 8, 9, 10, 11, 12, 13 but it id not happening to all users on those versions. We also see a variety of manufacturers & models (Samsung, Xiaomi, Motorola, etc) so it is not related to a specific manufacturer/model either. Proguard is just configured as as the quickstart project
and the most common crashes come from one of these 3 functions calls:
I can see in the logs that it is usually after a call has ended (but I can't confirm that is the case 100% of the time). We are honestly a bit at a lost with this and not sure how to proceed/fix it. |
yeah you and me both... I'll throw in a ticket on our end to remove that dead function.. as for clients in the field... I have no idea at this point in time.. I have not been able to repo on our end. |
Definitely happening in newer versions. We have been using 6.4.0 for the last couple of versions of our app and still see crashes in That code must somehow be used as we obviously don't interact with the native code itself. Maybe it is some kind of internal thread of the native sdk calling itself? The second and third biggest sources of crashes coming from the native sdk are in case they are related:
We will keep an eye on when a new version is published and we will see what happens. Ps. Many thanks for the effort you are putting to look into this 🙏 . Ps2. Proportionally with the amount of use we do of the SDK the crashes are small, but at the moment the Twilio SDK is the biggest source of crashes in our app which is something we need to address obviously |
Hello, just my two cents, We also reduced the number of crashes by making sure that all calls to Twilio SDK are wrapped within the same thread. |
@YvesDelerm yes, all the Twilio api calls must come from the same thread, its not thread safe.. As for Java_com_twilio_voice_JniUtils_nativeJavaUtf16StringToStdString, we recently removed it entirely (not yet released), its was not being called internally either, it was a vestige from the past that was just dead. It is a complete mystery how it is ever being invoked.... |
Ok cool.
|
As for |
Perfect, we are revisiting how we call the SDK to make sure that we always use the Thanks for the response and the tips 🙏 |
FYI, the release made yesterday (6.4.1) contains the removal of the unused method |
Great, thanks for letting me know. We will update to the latest version and will let you know in a week or so when we release if we stop seeing crashes. |
Hi @jamesbluecrow - did you get a chance to validate Voice Android 6.4.1 release? |
Hey @kbagchiGWC @afalls-twilio! Yes, I can confirm that in I think this issue can now be closed. Thank you for your help folks 🙏 |
@jamesbluecrow Thanks for validation the behavior. I will close the ticket as completed. |
Description
Voice NDK crashes com_twilio_voice_JniUtils_nativeJavaUtf16StringToStdString
Steps to Reproduce
Unknown, these issues are being surfaced to us via crashlytics.
Code
Proguard rules being used:
Expected Behavior
The app does not crash
Actual Behavior
The app crashes
Reproduces How Often
About 1-2% of our users have experienced one of these 2 crashes.
Twilio Call SID(s)
Unknown.
Logs
Java_com_twilio_voice_JniUtils_nativeJavaUtf16StringToStdString
Java_com_twilio_voice_JniUtils_nativeJavaUtf16StringToStdString
Versions
Kotlin: 1.9.0
Android gradle plugin: 8.1.1
com.twilio:audioswitch: 1.1.8
Voice Android SDK
com.twilio:voice-android:6.3.2
OS Version
Various but primarily: 14, 13, 12, 10
Device Model
Various: Samsung, Xiaomi, Google, etc.
The text was updated successfully, but these errors were encountered: