0

I would like to integrate the twilio library to my android app. As mentioned on their website I am using

implementation group: "com.twilio.sdk", name: "twilio", version: "8.10.0"

inside the dependencies block of the build.gradle. This leads to the error

More than one file was found with OS independent path 'META-INF/DEPENDENCIES'.

According to this topic I tried to add

android {      
      packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/ASL2.0'
        exclude("META-INF/*.kotlin_module") 
      }          
}`

Then I am getting an error that the process can´t access \TestProject\app\build\intermediates\merged_java_res\debug\out.jar, because it is used by another one.

erik-stengel
  • 344
  • 2
  • 12

1 Answers1

1

Twilio developer evangelist here.

The Twilio Java library is not suitable for and doesn't support the Android platform.

I don't actually know what the technical limitation is, though there is one. More important is that using the Twilio SDK within your application would require you to embed or include somehow your account credentials. The application could then be disassembled and your credentials extracted, allowing a malicious user to abuse your Twilio account and spend your credit.

Instead, we recommend you make calls to the Twilio API from your own server as a proxy that can keep your credentials secure. Here's an example of how to send an SMS message from Android using Twilio.

Alternatively, you may have the wrong Twilio library. Please see the following links for alternative libraries:

philnash
  • 70,667
  • 10
  • 60
  • 88
  • Hello @philansh can you please provide any tutorial for best practices coding. right now i have my own server for generating access token and create room chat but i'm confuse in android how to implement. so please provide proper example for android. – Kaushal Panchal Mar 02 '22 at 09:58
  • There are lots of examples in the Twilio documentation. Have you checked there? – philnash Mar 02 '22 at 10:01
  • Yes i checked. but to much confusion. right now i'm start integration twilio conversations and none of any example available. so if you have any blog or tutorial then please share. It's really help for me and also it's save my time. – Kaushal Panchal Mar 02 '22 at 10:43
  • I would check in on the [Android Conversations quick start and this walkthrough of it](https://www.twilio.com/docs/conversations/android/exploring-conversations-android-quickstart). – philnash Mar 02 '22 at 10:48
  • Yes i refer this, but still confuse how to get data of incoming message user. can we discuss over LinkedIn or somewhere else? – Kaushal Panchal Mar 02 '22 at 10:52
  • I’m not an Android developer. Did you you check this section on [receiving messages](https://www.twilio.com/docs/conversations/android/exploring-conversations-android-quickstart#receiving-new-messages)? – philnash Mar 02 '22 at 10:57
  • Oh. Yes i checked – Kaushal Panchal Mar 02 '22 at 10:58
  • 1
    Stack Overflow is a great place to ask specific questions. I recommend you ask a new question, share what you’ve tried and where you’re stuck. Then someone with experience may be able to help you. – philnash Mar 02 '22 at 11:01