由于棉绒和杂物,Gradle清洁失败木材

时间:2016-03-02 14:29:53

标签: android gradle lint timber

在Windows 7上使用Android Studio 1.5.1,以及gradle 2.8或2.10,尝试运行gradle clean时出现以下错误(仅在使用Timber时):

gradle clean
Incremental java compilation is an incubating feature.                           
WARNING [Project: :app] To shrink resources you must also enable ProGuard         
:clean                                                                               
:app:clean FAILED          

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:clean'.
> Unable to delete file: C:\blabla\app\build\intermediates\exploded-aar\com.jakewharton.timber\timber\4.1.0\jars\lint.jar

* Try:         
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

发现这个: https://code.google.com/p/android/issues/detail?id=190812 然后: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=5041014 但对于Android Studio& gradle,我们无法控制编译(因此无法控制URLClassLoader调用)。

谢谢!

2 个答案:

答案 0 :(得分:3)

在build.gradle中禁用所有Timber的lint检查:

android {

  lintOptions {
    disable 'LogNotTimber', 'StringFormatInTimber', 'ThrowableNotAtBeginning', 'BinaryOperationInTimber', 'TimberArgCount', 'TimberArgTypes', 'TimberTagLength'
  }
}

我还建议您提交修复此问题的PR,以便重新启用这些检查。你不想无限期地压制这些。

答案 1 :(得分:0)

将木材从4.x.x降级到3.1.0