Gradle 中的 Android Studio 清单缺少错误 [英] Android Studio Manifest Missing Error In Gradle

查看:36
本文介绍了Gradle 中的 Android Studio 清单缺少错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力弄清楚我对我的项目做了什么.我最近在主 project/library/ActionBarSherlock 下将 ActionBarSherlock 添加到我的项目中.当我这样做时,我的清单文件路径发生了一些事情,因为现在项目找不到它,并且我在调试时收到此错误.

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.

摇篮:

FAILURE:构建失败,出现异常.

FAILURE: Build failed with an exception.

  • 出了什么问题:配置根项目ToDoListProject"时出现问题.

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

      未能通知项目评估侦听器.C:\Users\Chris Johnson\AndroidStudioProjects\ToDoListProject\src\main\AndroidManifest.xml 中缺少主清单

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

    • 试试:使用 --stacktrace 选项运行以获取堆栈跟踪.使用 --info 或 --debug 选项运行以获得更多日志输出.

    • 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?

      谢谢.

      推荐答案

      build.gradle 文件的 android 部分,您可以尝试添加 sourceSetsmanifest.srcFile 变量.

      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.

      这篇关于Gradle 中的 Android Studio 清单缺少错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆