twilio / voice-quickstart-android

Quickstart app for the Voice Android SDK
https://www.twilio.com/docs/api/voice-sdk/android/getting-started
MIT License
184 stars 140 forks source link

Crash when adding Voice SDK to legacy Android project #533

Closed darkengine closed 2 years ago

darkengine commented 2 years ago

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_Call0002d_00024_00024Nest_00024mnativeGetSid and Java_com_twilio_voice_Call__0002d_00024_00024Nest_00024mnativeGetSidLcom_twilio_voice_Call_2J)

However, all .so libraries are sitting find inside the SDK.

Steps to Reproduce

  1. Add Twilio SDK to an old project.
  2. Run this app and start VoiceActivity.
  3. Click call.

How to fix

  1. Update the Java version from 8 to 11
  2. Update Android gradle plugin (to com.android.tools.build:gradle:7.2.1) , and gradle (to gradle-7.3.3)
  3. Clear everything like cached and build folder: Run file -> invalidate caches -> Clear file system cache and Local history
  4. 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_Call0002d_00024_00024Nest_00024mnativeGetSid and Java_com_twilio_voice_Call__0002d_00024_00024Nest_00024mnativeGetSidLcom_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

kbagchiGWC commented 2 years ago

@darkengine

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.

darkengine commented 2 years ago

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