Android studio gradle重复文件dagger编译器

Pal*_*ima 11 android gradle dagger android-studio

将android studio更新为0.4.0并将gradle插件更新为0.7.1并使用dagger编译器将gradle版本更新为1.9后出现奇怪问题

的build.gradle

android {
packagingOptions {
    exclude 'META-INF/DEPENDENCIES.txt'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
}
}
    dependencies {
    compile 'com.android.support:support-v4:+'
    compile 'com.android.support:support-v13:19.0.+'
    compile 'com.google.code.gson:gson:2.2.4'
    compile 'com.squareup.dagger:dagger:1.2.0'
    compile 'com.squareup.dagger:dagger-compiler:1.2.0'
}
Run Code Online (Sandbox Code Playgroud)

在构建中收到此错误

Execution failed for task ':MyApplication:packageDebug'.
Run Code Online (Sandbox Code Playgroud)

在APK META-INF/services/javax.annotation.processing.Processor中复制的重复文件文件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文件2:C:\ Users\Mantas.gradle\caches\modules-2\files-2.1\com.squareup.dagger\dagger-compiler\1.2.0\22633bb84433e03d345a83e7b0c08c66768be30 \匕首编译-1.2.0.jar

如果匕首编译器行被评论一切正常

我怎么解决这个问题?谢谢

EDITED 固定的问题,检查 https://plus.google.com/+HugoVisser/posts/7Wr3FcdNVxR

ast*_*ryk 2

如果您知道哪些文件被重复,您始终可以编译它们,但有如下例外:

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'
}
Run Code Online (Sandbox Code Playgroud)

请确保在执行此操作时将依赖项包含在()使用外壳中,否则它将无法工作。