Skip to content

Instantly share code, notes, and snippets.

@keigoi
Last active April 17, 2018 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keigoi/d14026db1b5199791caae2782600263e to your computer and use it in GitHub Desktop.
Save keigoi/d14026db1b5199791caae2782600263e to your computer and use it in GitHub Desktop.

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