Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

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:

  1. $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}"
    }
}
  1. gradle.properties:
android.enableAapt2=false

(C:/Users/keigoi/.gradle/gradle.properties に置きたい)

  1. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.