Android studio: this project is not gradle based p

2019-06-12 05:21发布

问题:

I have one project which was initially in eclipse, then i managed somehow to convert it to gradle and everything was working fine in Android Studio.

But then i didn't work some time with the project and after few months when i returned to project i am surprised that Android Studio has problems with this project.

When i selected "Android" from top left dropdown in AS, where you should see the project as Android, i saw no files, then i did something and now i see there one empty folder Java.

If i hit button "sync project with gradle files" AS says message as posted in name of question, but it is gradle based project.. there are gradle files etc.

Do you someone know why is this problem? Why it should stop work like this?

Thank you

回答1:

Make sure you open the project from its root directory. i.e. the directory which contains the top level build.gradle file.

The missing top level gradle file is what causes this error.



回答2:

My project stopped showing all of sudden and already had build.gradle file. I just reopened it via File > Open.