Android Studio “IDE error occured” on create new Activity

I ended up downgrading to 2.3.3 by getting the old version there:

After testing with the solution posted here, the problem ended up being only that line in the project Gradle file:

buildDir = "C:/tmp/${}/${}"

If you remove that line then everything will work. The other solution contains additional changes but they are not needed to fix the problem.

No need to downgrade. Just ensure you:

(a) apply gradle plugin 3.0.0, (b) add the repo references to “google()”, and (c) remove the buildDir code from your project gradle file.

allprojects {
    //String osName = System.getProperty("").toLowerCase();
    //if (osName.contains("windows")) {
    //    buildDir = "C:/tmp/${}/${}"
    repositories {

I could add a new activity to an existing project after these steps.

Leave a Comment