title: Cannot relocate dependencies using shadow plugin for gradle
body: <p>I have a project wich uses a library which is contained in an aar file. The problem is that my application uses daager 1 for dependency Injection, it uses Dagger 1 because I use a framework that is compatible only with dagger 1. The problem is that the library I need to use uses Dagger 2 for dependency injection so when I add the library and I add the depencies in my application gradle file it doesn't work (as expected because Dagger 1 and Dagger 2 cannot be used at the same time out of the box), so I am trying to relocate the Dagger 2 depencencies using the shadow plugin.</p>
  
  <p>I followed this tutorial on how to do it <a href="http://fernandocejas.com/2016/08/03/android-dagger-1-and-2-living-together/" rel="noreferrer">http://fernandocejas.com/2016/08/03/android-dagger-1-and-2-living-together/</a></p>
  
  <p>the jar files are generated inside the modules but are empty, they don't contain the renamed files for Dagger 2. I downloaded the project from github <a href="https://github.com/android10/two-daggers" rel="noreferrer">https://github.com/android10/two-daggers</a> and it works but I can manage to get it working in my project.</p>
  
  <p>My gradle files from the modules created are an exact copy from those in the tutorial. Can you see what I am doing wrong?</p>
  
  <p>Also the shadow.gradle is an exact copy.</p>
  
  <p>The only difference is my build.gradle from my app which is </p>
  
  <pre><code>apply plugin: 'com.android.application'
  apply plugin: 'com.neenbedankt.android-apt'
  apply plugin: 'com.jakewharton.hugo'
  
  
  android {
      compileSdkVersion 23
      buildToolsVersion "23.0.3"
  
  defaultConfig {
      applicationId "com.xxx.xxx"
      minSdkVersion 16
      targetSdkVersion 23
      versionCode Integer.parseInt("$APP_VERSION_CODE")
      versionName "$APP_VERSION_NAME"
  
      testInstrumentationRunner "com.android.test.runner.MultiDexTestRunner"
  
      // Enabling multidex support.
      multiDexEnabled true
  
  }
  
  testBuildType "instrumentation"
  
  compileOptions {
      sourceCompatibility JavaVersion.VERSION_1_7
      targetCompatibility JavaVersion.VERSION_1_7
  }
  
  dexOptions{
      javaMaxHeapSize "3g"
      incremental true
  }
  
  testOptions {
      unitTests.returnDefaultValues = true
  }
  
  
  
  //Append version to Apk name
  applicationVariants.all { variant -&gt;
      variant.outputs.each { output -&gt;
          def outputFile = output.outputFile
          if (outputFile != null &amp;&amp; outputFile.name.endsWith('.apk')) {
              def fileName = outputFile.name.replace('app-', "AccessApp-")
              fileName = fileName.replace('.apk', "-" + "$APP_TAG" + ".apk")
              output.outputFile = new File(outputFile.parent, fileName)
          }
      }
  }
  
  packagingOptions {
      exclude 'LICENSE.txt'
      exclude 'META-INF/services/javax.annotation.processing.Processor'
  }
  
  lintOptions {
      abortOnError false
      disable 'InvalidPackage'
  }
  }
  
  buildscript {
      repositories {
          maven {
              url "https://plugins.gradle.org/m2/"
          }
      }
  dependencies {
      classpath "com.github.jengelman.gradle.plugins:shadow:1.2.3"
      classpath "com.neenbedankt.gradle.plugins:android-apt:1.4"
  }
  }
  
  apply plugin: "com.github.johnrengelman.shadow"
  
  dependencies {
      repositories {
          maven {
              url "http://xxx.xx.xxx:0000/xxx/xxxxxx/"
      }
          jcenter()
          flatDir {
              dirs 'libs'
          }
      }
  
  //Dagger 1
  apt 'com.squareup.dagger:dagger-compiler:1.2.2'
  compile 'com.squareup.dagger:dagger:1.2.2'
  
  //Dagger 2
  apt project(path: ':two-daggers-compiler', transitive: false)
  compile project(path: ':two-daggers-library', transitive: false)
  
  compile fileTree(dir: 'libs', include: ['*.jar'])
  
  //Unit Tests
  testCompile 'junit:junit:4.12'
  testCompile 'org.mockito:mockito-core:1.10.19'
  testCompile 'org.apache.maven:maven-ant-tasks:2.1.3'
  testCompile 'joda-time:joda-time:2.3'
  testCompile 'com.squareup.okhttp3:mockwebserver:3.2.0'
  testCompile('org.robolectric:robolectric:3.0') {
      exclude group: 'commons-logging', module: 'commons-logging'
      exclude group: 'org.apache.httpcomponents', module: 'httpclient'
  }
  
  // Android instrumentation test dependencies
  androidTestCompile 'junit:junit:4.12'
  androidTestCompile 'com.android.support.test:runner:0.4.1'
  // Set this dependency to use JUnit 4 rules
  androidTestCompile 'com.android.support.test:rules:0.4.1'
  // Set this dependency to build and run Espresso tests
  androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
  androidTestCompile 'com.android.support:support-annotations:23.4.0'
  
  // Android dependencies
  compile 'com.android.support:support-v4:23.4.0'
  compile 'com.android.support:appcompat-v7:23.4.0'
  compile 'com.android.support:design:23.4.0'
  compile 'com.android.support:cardview-v7:23.4.0'
  
  //Rosie Framework
  compile 'com.karumi.rosie:rosie:2.1.0'
  
  // Connectivity library
  compile 'com.xxx.connectivity:connectivity:1.0.0.013@aar'
  
  // Maps
  compile 'com.google.android.gms:play-services-maps:8.4.0'
  compile 'com.google.android.gms:play-services-location:8.4.0'
  compile 'com.google.android.gms:play-services-gcm:8.4.0'
  compile 'com.google.android.gms:play-services-base:8.4.0'
  compile 'com.google.maps.android:android-maps-utils:0.4.3'
  
  // Hockey App
  compile 'net.hockeyapp.android:HockeySDK:4.0.2'
  
  //Retrofit
  compile 'com.squareup.retrofit2:retrofit:2.0.2'
  compile 'com.squareup.retrofit2:converter-gson:2.0.2'
  compile 'com.squareup.retrofit2:converter-scalars:2.0.2'
  compile 'com.squareup.okhttp3:okhttp:3.2.0'
  compile 'com.squareup.okhttp3:logging-interceptor:3.2.0'
  
  // Images
  compile 'com.squareup.picasso:picasso:2.5.2'
  
  // Google Play Billing
  compile 'com.anjlab.android.iab.v3:library:1.0.31'
  compile 'joda-time:joda-time:2.3'
  
  // View pager indicator
  compile 'com.github.JakeWharton:ViewPagerIndicator:2.4.1@aar'
  compile 'me.grantland:autofittextview:0.2.1'
  
  // Event bus
  compile 'org.greenrobot:eventbus:3.0.0'
  
  //Roboto font
  compile 'uk.co.chrisjenx:calligraphy:2.2.0'
  
  //MixPanel
  compile "com.mixpanel.android:mixpanel-android:4.8.7"
  
  //Amazon
  compile "com.amazonaws:aws-android-sdk-mobileanalytics:2.2.9"
  
  //AppsFlyer
  compile 'com.appsflyer:af-android-sdk:4.5.0@aar'
  
  //Multidex
  compile 'com.android.support:multidex:1.0.1'
  androidTestCompile 'com.android.support:multidex-instrumentation:1.0.1'
  
  // Smart tab layout
  compile 'com.ogaclejapan.smarttablayout:library:1.6.1@aar'
  compile 'com.ogaclejapan.smarttablayout:utils-v4:1.6.1@aar'
  
  // Permissions
  compile 'com.karumi:dexter:2.2.2'
  
  // AP Geolocation
  compile 'com.fon.analytics:analytics-sdk:0.4.3'
  
  compile 'com.github.PhilJay:MPAndroidChart:v2.2.5'
  
  // WPA sharing library
  compile 'com.google.guava:guava:18.0'
  compile 'com.j256.ormlite:ormlite-android:4.48'
  compile 'com.j256.ormlite:ormlite-core:4.48'
  
  //multiDex
  compile 'com.android.support:multidex:1.0.1'
  }
  </code></pre>