'unable To Merge Dex' Error In Android Studio When Adding A Specific Compile In Dependencies
I'm trying to add a specific module into my Android project (this one over here: https://github.com/danysantiago/sendgrid-android), but while the project seems to build correctly,
Solution 1:
You need to exclude the httpclient from the library with this:
compile ('com.github.danysantiago:sendgrid-android:1'){
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
}
Solution 2:
Update in your gradle
defaultConfig {
..............
multiDexEnabled true
}
dexOptions should add..
dexOptions {
//incremental = true;
preDexLibraries = false
javaMaxHeapSize "4g"
}
dependency add
compile'com.android.support:multidex:1.0.1'
Also In Your AndroidManifest.xml add this lines android:name
<application
android:allowBackup="true"android:icon="@mipmap/ic_launcher"android:label="@string/app_name"android:supportsRtl="true"android:theme="@style/AppTheme"android:name="android.support.multidex.MultiDexApplication"
>
Solution 3:
There is a new Android SendGrid library utilising Sendgrid's v3 API. The updated library negates the issues when implementing older libraries into applications that target newer Android API version.
The library can be imported with jitpack
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
dependencies {
implementation 'com.github.jakebreen:android-sendgrid:1.2.2'
}
Post a Comment for "'unable To Merge Dex' Error In Android Studio When Adding A Specific Compile In Dependencies"