3

Using Android Studio 1.5.1 on Windows 7, and gradle 2.8 or 2.10, I got the following error when trying to run a gradle clean (only when using 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

Found this:
https://code.google.com/p/android/issues/detail?id=190812
and that:
http://bugs.java.com/bugdatabase/view_bug.do?bug_id=5041014
But for Android Studio & gradle, we have no control on the compilation (so no control over the URLClassLoader calls).

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Crachou
  • 53
  • 6

3 Answers3

6

Disable all of Timber's lint checks, in build.gradle:

android {

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

I also suggest submitting a PR that fixes the issue so you can turn these checks back on. You don't want to suppress these indefinitely.

Christopher Perry
  • 38,891
  • 43
  • 145
  • 187
1

Update Timber to 5.0.1 and probably com.android.tools.build:gradle to 7.0.0.

CoolMind
  • 26,736
  • 15
  • 188
  • 224
0

downgrade the timber from 4.x.x to 3.1.0