Android: project "MyProject" not found in root project "MyProject"

I am currently using Android Studio and I am trying to rebuild, but I am getting the following error.

Gradle: FAILURE: Build failed with an exception. * What went wrong: Project Project 'MyProject' not found in root project 'MyProject'. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. 

I would try Try: Run with --stacktrace, but I'm not sure how to do this. Can someone help me fix this issue? Thanks!

+4
source share
2 answers

If people still have problems:

It happened to me with me, and this happened because I renamed my application directory manually when trying to rename my project. \ Hello World \ app projects should be there, and it has build, libs, src files and some files in it. If it is called something else, then renaming it to the application through Windows Explorer can fix it.

+3
source

Assuming you are using Windows, open a command prompt and go to the project root and run gradlew build to see the error in more detail

 cd \androidstudio\MyProject gradlew build 

or run stacktrace with

 gradlew build --stacktrace 

A duplicate answer can be found here Android Studio: Where is the compiler error output window?

+1
source

Source: https://habr.com/ru/post/1482757/