Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find property 'allJava' on source set main

Hy, I am using Android Studio 0.6.0 as of this morning, during the upgrade process I had to switch to Gradle version 0.11 to compile my Android project.

Ever since I get this annoying error which prevents me from building my project.

Error:Could not find property 'allJava' on source set main.

This property is defined only for the 'java' plugin, but I am using the 'android' plugin in my build.gradle file, so I see no reason why I should receive this error.

Does anyone know how to get rid of this message?

UPDATE: I solved it, it seems this property is no longer available in Gradle 0.11.1, and somebody somewhere in my project was using it.

I found this line in one of the build.gradle files:

apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle'

which made a reference to another gradle configuration file, that used this property to make a task of generating JavaDocs for every .java file.

So in order to solve this problem, just look everywhere in your code for a reference to this property.

like image 297
Ovidiu Blejdea Avatar asked Jun 10 '14 11:06

Ovidiu Blejdea


1 Answers

In case anyone happens upon this thread, I did a little investigating into the Gradle Android plugin source.

It appears that the allJava property was removed as it was redundant with the java property. Swapping allJava out for 'java' seems to fix the issue.

https://android.googlesource.com/platform/tools/base/+/5e71a83f74258b85d7f5306bf743c4d69d6242f8%5E%21/#F2

Consequently, the allSource property was also removed, which will break the gradle-mvn-push script as well. I have submitted a bug report for that one, linked below.

https://code.google.com/p/android/issues/detail?id=71174

like image 199
cocoahero Avatar answered Oct 28 '22 22:10

cocoahero