title: How to remove single module from the jar file in gradle Android Studio
body: <p>How can i remove the single package from the jar file.</p>
  
  <p><a href="https://i.stack.imgur.com/9hFm6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9hFm6.png" alt="the package hierarchy "></a></p>
  
  <p>I have two SDK's from diffent vendors and both the SDK's have <strong>google.gson</strong> 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</p>
  
  <p><a href="https://i.stack.imgur.com/E6KHm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/E6KHm.png" alt="enter image description here"></a></p>
  
  <p>i know  how to exclude the modules  from the repository like this:</p>
  
  <pre><code>compile('com.android.support:design:23.1.1') {
          exclude module: 'support-v4'
      }
  </code></pre>
  
  <p>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.</p>
  
  <p>MY GRADLE FILE:</p>
  
  <pre><code>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'
  }
  </code></pre>