Reputation: 7636
I've just installed the latest Android Studio on to a new PC, and tried importing an existing project from my Git repo. However I'm getting the following error:
Error:(91, 0) Could not find method android() for arguments
[build_5rpi8n4wxkti5snnxm1rtlcug$_run_closure7@4154e46b]
on root project 'my_project' of type org.gradle.api.Project.
I've tried updating the module settings to use the latest Gradle version, but that didn't help. Any ideas on what that error means or where to look? I guess the org.gradle.api.Project class is missing an android method, meaning it's the wrong version or something?
Upvotes: 0
Views: 1092
Reputation: 7636
Finally fixed this myself! It turns out that Android Studio had added a section to the main build.gradle file that shouldn't be there...
At the bottom of the file was:
android {
/** couple of lines **/
}
Deleting that entire block has fixed my build. I'll leave the question up here, maybe it helps someone else having the same problem.
Upvotes: 1