Fix Gradle warnings after Android Studio 1.3 update
- 1 minutes read - 160 wordsUpdated on
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!
Happy coding!