Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android aar's have stopped building with extractDebugAnnotations com/intellij/psi/PsiJavaFile android

My build have recently stopped working for an open source gradle/android project. They've been working just fine until today (Oct 10 2016). I run a build matrix across multiple versions (on travis) of gradle and the gradle android plugin. Essentially, it's now failing on gradle 3.0 and 3, both with the gradle android 2.2.0 plugin. Other versions using different android plugins are ok. It's only the 2.2.0 plugin that's failing.

The part that baffles me is the error message

:hello-world-aar:preBuild UP-TO-DATE
:hello-world-aar:preDebugBuild UP-TO-DATE
:hello-world-aar:checkDebugManifest
:hello-world-aar:preDebugAndroidTestBuild UP-TO-DATE
:hello-world-aar:preDebugUnitTestBuild UP-TO-DATE
:hello-world-aar:preReleaseBuild UP-TO-DATE
:hello-world-aar:preReleaseUnitTestBuild UP-TO-DATE
:hello-world-aar:prepareOrgOsmdroidOsmdroidAndroid541ReleaseLibrary
:hello-world-aar:prepareDebugDependencies
:hello-world-aar:compileDebugAidl
:hello-world-aar:compileDebugNdk UP-TO-DATE
:hello-world-aar:compileLint
:hello-world-aar:copyDebugLint SKIPPED
:hello-world-aar:compileDebugRenderscript
:hello-world-aar:generateDebugBuildConfig
:hello-world-aar:generateDebugResValues
:hello-world-aar:generateDebugResources
:hello-world-aar:mergeDebugResources
:hello-world-aar:processDebugManifest
:hello-world-aar:processDebugResources
:hello-world-aar:generateDebugSources
:hello-world-aar:incrementalDebugJavaCompilationSafeguard
:hello-world-aar:compileDebugJavaWithJavac
:hello-world-aar:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
:hello-world-aar:extractDebugAnnotations FAILED

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':hello-world-aar:extractDebugAnnotations'.

> com/intellij/psi/PsiJavaFile

Again this is on an Android Archive (AAR) project. I've searched and can't find much on that class. It's not referenced anywhere in my code. My best guess is that google changed a support library or something that broke something. I'm also building from the command line via travis. I have no idea where the intellij stuff is coming from.

like image 852
spy Avatar asked Oct 11 '16 00:10

spy


3 Answers

fixed by clearing the cache with:

rm -rf ~/.gradle/caches/
like image 68
Pellet Avatar answered Nov 15 '22 20:11

Pellet


This has beed fixed according to https://code.google.com/p/android/issues/detail?id=224910 . You can rebuild your project with gradle command line after clear gracle cache locally (rm -rf ~/.gradle/caches/)

Also , you need do same operation on your CI agent .

like image 2
ending0421 Avatar answered Nov 15 '22 19:11

ending0421


I just faced the same issue. The problem in my project was an empty IntDef. If clearing gradle cache doesn't work, check if you don't have empty Def in your code, and remove them.

@IntDef({}) or @StringDef({}) ...

like image 2
Jems Avatar answered Nov 15 '22 19:11

Jems