After installing InstantRun the project could not compile any more with the following Gradle configuration error:
Could not get unknown property 'assembleRelease' for object of type com.android.build.gradle.internal.api.ApplicationVariantImpl.
Gradle previous code:
afterEvaluate {
assembleDebug.doLast {
copyApk(project.name, project.name, "debug")
}
assembleRelease.doLast {
copyApk(project.name, project.name, "release")
}
}
It seems the property assembleRelease do not exist under InstantRun, so the Gradle configuration file should be patched in this way:
afterEvaluate {
assembleDebug.doLast {
copyApk(project.name, project.name, "debug")
}
if (project.hasProperty("assembleRelease")) {
assembleRelease.doLast {
copyApk(project.name, project.name, "release")
}
}
}