Android studio gradle duplicate files dagger compiler

having strange problem after updating android studio to 0.4.0 and gradle plugin to 0.7.1 and gradle version to 1.9 with dagger compiler


  • Best way to have an Android app poll periodically in the background
  • How can i send back data using finish?
  • How do I use the Android Geofencing API?
  • Android camera resulted image should be rotated after the capture?
  • gradle - library duplicates in dependencies
  • OK button in “Create new Android Virtual Device (AVD)” dialog does not do anything
  • android {
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        dependencies {
        compile ''
        compile ''
        compile ''
        compile 'com.squareup.dagger:dagger:1.2.0'
        compile 'com.squareup.dagger:dagger-compiler:1.2.0'

    on build getting this error

    Execution failed for task ':MyApplication:packageDebug'.

    Duplicate files copied in APK META-INF/services/javax.annotation.processing.Processor
    File 1: C:\Users\Mantas.gradle\caches\modules-2\files-2.1\com.squareup.dagger\dagger-compiler\1.2.0\22633bb84433e03d345a83e7b0c08c66768be30\dagger-compiler-1.2.0.jar
    File 2: C:\Users\Mantas.gradle\caches\modules-2\files-2.1\com.squareup.dagger\dagger-compiler\1.2.0\22633bb84433e03d345a83e7b0c08c66768be30\dagger-compiler-1.2.0.jar

    if dagger compiler lines is commented everything works fine

    how can i solve this problem?

    fixed problem, check

  • How to configure SSL certificates with Charles Web Proxy and the latest Android Emulator on Windows?
  • Volley Not Parsing 404 response
  • Tips for optimizing a website for Android's browser?
  • FragmentStatePagerAdapter with ChildFragmentManager - FragmentManagerImpl.getFragment results in NullPointerException
  • Understanding of isFinishing()
  • Using the Android InApp Billing V3 example. Hit Buy, Back Button, and buy again causes error
  • One Solution collect form web for “Android studio gradle duplicate files dagger compiler”

    If you know which files are being duplicated you can always compile them with exceptions like this:

    dependencies {
       compile('com.squareup.dagger:dagger:1.2.0') {
       exclude module: 'moduleName' //by artifact name
       exclude group: 'groupName' //by group
       exclude group: 'com.unwanted', module: 'moduleName' //or by both
       compile 'com.squareup.dagger:dagger-compiler:1.2.0'

    Just be sure that when you are doing this you enclose the dependancy in () to use the enclosure or it wont work.

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.