Android Studio Manifest Missing Error In Gradle

chris84948 picture chris84948 · Jun 13, 2013 · Viewed 55.2k times · Source

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.

Answer

ootinii picture ootinii · Jun 13, 2013

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.