Crash when adding Voice SDK to legacy Android project
darkengine opened this issue · 2 comments
Description
For someone adding Twilio Voice Android SDK to a legacy project.
I spend the whole afternoon fixing this: App crash when I fill target number and click "Call".
The log is:
java.lang.UnsatisfiedLinkError: No implementation found for java.lang.String com.twilio.voice.Call.-$$Nest$mnativeGetSid(com.twilio.voice.Call, long) (tried Java_com_twilio_voice_Call__0002d_00024_00024Nest_00024mnativeGetSid and Java_com_twilio_voice_Call__0002d_00024_00024Nest_00024mnativeGetSid__Lcom_twilio_voice_Call_2J)
However, all .so libraries are sitting find inside the SDK.
Steps to Reproduce
- Add Twilio SDK to an old project.
- Run this app and start VoiceActivity.
- Click call.
How to fix
- Update the Java version from 8 to 11
- Update Android gradle plugin (to com.android.tools.build:gradle:7.2.1) , and gradle (to gradle-7.3.3)
- Clear everything like cached and build folder: Run file -> invalidate caches -> Clear file system cache and Local history
- restart Android studio and everything will be OK.
Expected Behavior
App running well
Actual Behavior
App crash
Reproduces How Often
Always
Logs
java.lang.UnsatisfiedLinkError: No implementation found for java.lang.String com.twilio.voice.Call.-$$Nest$mnativeGetSid(com.twilio.voice.Call, long) (tried Java_com_twilio_voice_Call__0002d_00024_00024Nest_00024mnativeGetSid and Java_com_twilio_voice_Call__0002d_00024_00024Nest_00024mnativeGetSid__Lcom_twilio_voice_Call_2J)
Voice Android SDK
com.twilio:voice-android:6.1.1
com.twilio:audioswitch:1.1.4
OS Version
Android 11
Device Model
Samsung
We provide guidance for the developers in this QS app. The dependencies and their versions are indicated in the project build.gradle
file including the java version JavaVersion.VERSION_11.
Let us know how we could have documented this better to help your situation.
@kbagchiGWC The QS app helps a lot when I implement my own business logic.
But I think a comment like 'Java 11 or higher is a MUST' should leave in the build.gradle file.