Menu

Expand
Rate this page:

Using Twilio Voice side by side with WebRTC - Android

Twilio's Programmable Voice SDK for Android is based upon a fork of the Chromium WebRTC project (webrtc.org). This heritage usually presents an interesting challenge of class conflicts when using other WebRTC dependencies alongside Twilio in your Android application. We have designed Voice SDK 3.2.0 and above to work alongside other libraries that also inherit from webrtc.

How do conflicts occur?

Prior versions of the Voice Android SDK 3.2.0 could not be pulled into a project alongside other WebRTC dependent libraries due to class conflicts in the package org.webrtc` and conflicting native module names (libjingle_peerconnection_so).

We have modified the classpath of any java files used from org.webrtc.* to tvo.webrtc.*. With this change calling APIs to any class in org.webrtc.* will have no effect within the Voice SDK.

Perform the following modifications to your proguard file when compiling the Voice SDK for a release build with obfuscation.

  • Change -keep class org.webrtc.** { *; } to -keep class tvo.webrtc.** { *; }
  • Change -dontwarn org.webrtc.** to -dontwarn tvo.webrtc.**

The following snippet shows the correct ProGuard rules.

Voice Android 3.2.0+

# Twilio Programmable Voice
-keep class com.twilio.** { *; }
-keep class tvo.webrtc.** { *; }
-dontwarn tvo.webrtc.**
-keep class com.twilio.voice.** { *; }

If you wish to use Twilio Voice side by side with other WebRTC dependencies we recommend that you update to 3.2.x or above to eliminate class conflicts.

Note: Compiling alongside another WebRTC library was not a problem in 2.x because the media engine was different.

Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Community Forums or browsing the Twilio tag on Stack Overflow.

        
        
        

        Thank you for your feedback!

        We are always striving to improve our documentation quality, and your feedback is valuable to us. Please select the reason(s) for your feedback or provide additional information about how we can improve:

        Sending your feedback...
        🎉 Thank you for your feedback!
        Something went wrong. Please try again.

        Thanks for your feedback!

        Refer us and get $10 in 3 simple steps!

        Step 1

        Get link

        Get a free personal referral link here

        Step 2

        Give $10

        Your user signs up and upgrade using link

        Step 3

        Get $10

        1,250 free SMSes
        OR 1,000 free voice mins
        OR 12,000 chats
        OR more