0

I updated Android Studio to 2.1.3 and faced some problems which I got tired trying to solve them, I did researches on the internet and found solutions but they did not work .

1- When I open one of the previous projects which I made with the previous version it shows this message :

Could not find method android() for arguments [build_271i3j5ikj90u04cm3b2z7cj$_run_closure2@769ff8fb] on root project 'MyApp' of type org.gradle.api.Project

2- and under gradle root I did not find "build.gradle(Module:app)" file .

On other hand when I create a new project I have no problem and "build.gradle(Module:app)" file is exist and everything is OK . [enter image description here][2] any one help and thanks very much in advance .Could not find method android() for arguments in Android Studio 2.1.3

Ali Bahaj
  • 11
  • 1
  • 5

2 Answers2

0

The structure of your project is wrong.

You should have:

root
|--build.gradle
|--settings.gradle
|--module (ButtonAnimations)
|----build.gradle
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
0

try to remove the gradle folder and rebuild your project again.

  • Do you mean gradle folder which is in user folder ? I have deleted it and run Android Studio again and let it download gradle stuff from the internet , but it does not work – Ali Bahaj Sep 27 '16 at 10:05
  • One thing I forget to mention in my question that : when I open one of the old projects while the internet is connected it download gradle stuff for that project not for all projects , and it works good , which means it will download about 200 or 300 MB for each project !!! – Ali Bahaj Sep 27 '16 at 10:12
  • in that solution the code must be in "build.gradle(Module:app)" file which is not found in my situation , How can I do to get "build.gradle(Module:app)" file – Ali Bahaj Sep 28 '16 at 13:07
  • try to create another project and take that file from it and put it into your project Or move your Project Code to it. – Ibrahim Abousalem Sep 28 '16 at 15:24
  • if I download the latest version 2.2 does that gonna solve the problem ? – Ali Bahaj Oct 11 '16 at 04:14