Have you just updated Android Studio to version 1.3 Beta and have you found yourself overwhelmed by all the warnings in the Gradle files?
‘dependencies’ cannot be applied to ‘(groovy.lang.Closure)’
‘defaultConfig’ cannot be applied to ‘(groovy.lang.Closure)’
and so on….
Feeling desperate? Now you’re wondering why you press that update button… Don’t worry!
To fix the issue simply close the project (File / Close project), then select “Open an existing Android Studio project” on the start menu and select the folder that contains your Android project. Beware, select the folder, not the .iml project file.
Android Studio would take care to upgrade the project files and some extra xml files.
Now you should only need to accept to add the folder as VCS root (you’re versioning your code, right??), update the main build.gradle file (the one shown in the image that resides in the root project folder) to use Gradle 1.2.3 and you are reading to go!
My name is Alessio Franceschelli. I'm a software developer based in London, UK. I work as Principal Engineer for Trainline but these blog's opinions are my own.