Search code examples
androidokhttpjitsi

Embed OkHTTP to jitsi-meet in my app


I have developed a 'jitsi-meet' Android Application, and I want to add 'OkHttp' for listening web socket connections. My Android Studio version is 3.0.0.

implementation 'org.jitsi.react:jitsi-meet-sdk:1.9.0'
implementation 'com.squareup.okhttp3:okhttp:3.7.0'

When I add both dependencies to my 'AndroidManifest.xml' as above, it gives the following error:

Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

I have followed all the instructions given to re-correct the error,but still it appears, and only appears when both dependencies are mentioned. Is it due to incompatibility in dependencies of 'Jitsi Meet' and 'OkHttp'? Then, how could it be resolved?


Solution

  • The error is occurred due to the incompatibility of ReactJS version used in 'Jitsi-Meet' and 'OkHttp' libraries. In order to acquire the compatibility, you can change the version of 'OkHttp' (from 3.7.0 to 3.4.1):

    implementation 'com.squareup.okhttp3:okhttp:3.4.1'
    

    Then the error will not occur, and could successfully occupy both dependencies.