Some more details are here (in Japanese)
Students have their projects on the network drive. To optimise build time, we want to put build dir on the local drive. However, we cannot have separate source dirs and build dirs due to the following bug: https://issuetracker.google.com/issues/68936311
An workaround is to turn off AAPT2 (which is discouraged and will not be usable after 2019).
Anyway, the following will do that:
- $GRADLE_USER_HOME/init.gradle (in my case: c:/android/.gradle/init.gradle)
gradle.projectsLoaded {
rootProject.allprojects {
buildDir = "c:/android/build/${rootProject.name}/${project.name}"
}
}
- gradle.properties:
android.enableAapt2=false
(C:/Users/keigoi/.gradle/gradle.properties に置きたい)
- Disable Instant run in Android Studio settings
try: creating junction to local dir: e.g. Z:/AndroidStudioProjects/build <=> C:/android/build (admin priviledge required)
GRADLE_USER_HOME=c:/android/.gradle