How can i remove the single package from the jar file.
I have two SDK's from diffent vendors and both the SDK's have google.gson package included in the jar files, because this causing me the issue in running a build in android studio it shows the error in image below
i know how to exclude the modules from the repository like this:
compile('com.android.support:design:23.1.1') {
exclude module: 'support-v4'
}
but i don't know how to exclude some package from the jar file that i need in my application. Any help would be appreciated.
MY GRADLE FILE:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'libs/SDK/com.google.gson'
}
defaultConfig {
applicationId "**********"
minSdkVersion 16
targetSdkVersion 21
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}
dexOptions {
preDexLibraries = false
javaMaxHeapSize "4g"
}
}
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
compile('com.facebook.android:facebook-android-sdk:4.1.0') {
exclude module: 'support-v4'
}
compile('org.twitter4j:twitter4j-core:4.0.2') {
exclude module: 'support-v4'
}
compile('com.android.support:design:22.2.0') {
exclude module: 'support-v4'
}
compile files('libs/FlurryAnalytics-5.3.0.jar')
compile files('libs/gcm.jar')
compile('com.android.support:design:23.1.1') {
exclude module: 'support-v4'
}
compile files('libs/SDK.jar')
compile project(':volley')
compile project(':viewPagerIndicator')
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.squareup.picasso:picasso:2.5.0'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.+'
compile 'com.android.support:support-v4:23.1.0'
compile project(':android-country-picker-master')
compile 'com.google.code.gson:gson:2.2.4'
compile 'javax.annotation:javax.annotation-api:1.2'
}