解决Execution failed for task':app:packageDebugResources'

我使用的开发工具是Android Studio Bumblebee | 2021.1.1 Patch 3

项目中引入了一个名叫app的Module,编译时报错

列出Terminal执行gradlew build编译的报错的完整信息:

* What went wrong:
Execution failed for task ':app:packageDebugResources'.
> Error while evaluating property 'namespace' of task ':app:packageDebugResources'
   > Failed to calculate the value of task ':app:packageDebugResources' property 'namespace'.
      > Failed to query the value of property 'namespace'.
         > Manifest file does not exist: D:\...\app\src\main\AndroidManifest.xml

经查找,是因为我创建的Module里是没有AndroidManifest.xml这个文件的,现添加此文件到main目录下:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.xxx.xxx.xxx.app">
</manifest>

项目编译时,继续报错,报错内容:

* What went wrong:
Execution failed for task ':app:lintDebug'.
> Lint found errors in the project; aborting build.

  Fix the issues identified by lint, or create a baseline to see only new errors:
  ```
  android {
      lint {
          baseline = file("lint-baseline.xml")
      }
  }
  ```

采用的方式是,直接忽略掉该报错,在Module的.gradle中加入一下代码:

android {
    ...
    lint {
        abortOnError false
    }
    ...
}

 

posted @ 2022-10-21 17:04  swalka`x  阅读(2957)  评论(0)    收藏  举报