用 Dagger 编译器将android studio更新为0.4.0并将gradle插件更新为0.7.1并将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'
}
在生成此错误
Execution failed for task ':MyApplication:packageDebug'.
如果对dagger编译器行进行了注释,则一切正常
我怎么解决这个问题?
谢谢
编辑过
解决的问题,检查
https://plus.google.com/+HugoVisser/posts/7Wr3FcdNVxR
最佳答案
如果您知道要复制的文件,则可以始终使用以下异常对其进行编译:
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'
}
只要确保在执行此操作时,您就将依赖项包含在
()
中以使用该附件,否则它将无法正常工作。