Saturday, December 22, 2018

android - React Native: External Library Dex Merger Error on an video conference API

I am working on building a video conferencing react-native app using agora.io API. When I am trying to run the app , it gives me a dex merger error.





Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: /Users/appleretina/Documents/GitHub/agoraVideoCall-master/android/app/build/intermediates/transforms/dexBuilder/debug/0.jar, /Users/appleretina/Documents/GitHub/agoraVideoCall-master/android/app/build/intermediates/transforms/dexBuilder/debug/1.jar, /Users/appleretina/Documents/GitHub/agoraVideoCall-master/android/app/build/intermediates/transforms/dexBuilder/debug/2.jar,/Users/appleretina/Documents/GitHub/agoraVideoCall-master/android/app/build/intermediates/transforms/dexBuilder/debug/3.jar, /Users/appleretina/Documents/GitHub/agoraVideoCall-master/android/app/build/intermediates/transforms/dexBuilder/debug/4.jar, /Users/appleretina/Documents/GitHub/agoraVideoCall-master/android/app/build/intermediates/transforms/dexBuilder/debug/5.jar
...




I have already tried all the listed solutions for dex merger errors including deleting the build folders, setting multiDexEnabled to true, excluding the duplicated dependencies but none of the solutions worked in my case.



App.gradle :



android {

compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
applicationId "com.agoravideocall"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
multiDexEnabled true


ndk {
abiFilters "armeabi-v7a", "x86"
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK

include "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
// applicationVariants are e.g. debug, release

applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}

}
}
}

dependencies {
compile project(':react-native-agora')
implementation project(':react-native-agora')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules

}



build.gradle (agora video call)



apply plugin: 'com.android.library'

android {
compileSdkVersion rootProject.ext.compileSdkVersion

buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"


testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"


}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}


dependencies {
implementation "com.facebook.react:react-native:+"
implementation fileTree(dir: 'libs', include: ['*.jar'])
}



How do I solve this issue.

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...