Could not find method android() for arguments when building Android project from gradle
I have an gradle-based Android project with 4 submodules - two libraries and two applications. I was trying to simplify the build.gradle files of each submodule by moving some of of the shared code/configurations to the top level build.gradle file and use subprojects {} to make that code available to each submodule. The file system structure looks like this: Root |- App1/ |- App2/ |- Lib1/ |- Lib2/ |- build.gradle |- settings.gradle The problem is that if I add an android {} section to the subprojects then gradle tasks fail. For example, this is my top-level build.gradle file: subprojects {