Android Studio Manifest Missing Error In Gradle

57,047

Solution 1

In the android section of your build.gradle file, you can try adding sourceSets with the manifest.srcFile variable.

android {
  sourceSets {
      main {
          manifest.srcFile 'ToDoList/src/main/AndroidManifest.xml'
      }
  }
}

That path may need to be adjusted slightly.

Solution 2

You can do it from here open module settings -> Select modules tab -> click on your module -> from structure tab on the right change path for manifest file

you can find your manifest file inside [module name]/src/[sub directory]

Solution 3

I solved it by doing a clean via menu Build -> Clean project and a rebuild via menu Build -> Rebuild project

Share:
57,047
chris84948
Author by

chris84948

Spend my days working on WPF c# projects. Spend my nights imagining how to do exciting things before I get too tired. Someday want to create a game in Unity...

Updated on May 20, 2020

Comments

  • chris84948
    chris84948 almost 4 years

    I'm trying to figure out what I've done to my project. I recently added ActionBarSherlock to my project under the main project/library/ActionBarSherlock. When I did that something happened to my manifest file path because now the project cannot find it and I'm getting this error on Debug.

    Gradle:

    FAILURE: Build failed with an exception.

    • What went wrong: A problem occurred configuring root project 'ToDoListProject'.

      Failed to notify project evaluation listener. Main Manifest missing from C:\Users\Chris Johnson\AndroidStudioProjects\ToDoListProject\src\main\AndroidManifest.xml

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

    The reason it can't find the manifest is because it's located in the file

    C:\Users\Chris Johnson\AndroidStudioProjects\ToDoListProject\ToDoList\src\main\AndroidManifest.xml
    

    How do I set it to the correct location again?

    Thanks.