gradlew 命令行 build 调试 构建错误 Manifest merger failed MD
Markdown版本笔记 | 我的GitHub首页 | 我的博客 | 我的微信 | 我的邮箱 |
---|---|---|---|---|
MyAndroidBlogs | baiqiantao | baiqiantao | bqt20094 | baiqiantao@sina.com |
gradlew 命令行 build 调试 构建错误 Manifest merger failed MD
目录
解决 Manifest merger failed 问题
在android开发的时候,有时候会遇到这样的问题:
Manifest merger failed with multiple errors, see logs
但是要命的是,你管你怎么找,除了这个log,再没有什么其他的有用信息了,怎么办?
处理方式是这样的:
首先进入命令行,输入命令
gradlew processDebugManifest --stacktrace
PS:
Run gradlew tasks to get a list of available tasks.
Run with 【--stacktrace】 option to get the stack trace.
Run with 【--info】 or 【--debug】 option to get more log output.
Run with 【--scan】 to get full insights.
其中,processDebugManifest
是用于调试清单文件的,这个命令会获取更多的log
信息。
然后会输出很多信息,其中有用的是这一部分:
> Task :app:processDebugManifest FAILED
C:\Android\_coder\_workspace_as\DDComponent_Simple\app\src\main\AndroidManifest.xml:6:5-20:19 Error:
tools:replace specified at line:6 for attribute android:theme, but no new value specified
C:\Android\_coder\_workspace_as\DDComponent_Simple\app\src\main\AndroidManifest.xml Error:
Validation failed, exiting
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
卧槽,一看我就明白了,原来是这里写错了:
<application
android:name=".MyApplication"
android:allowBackup="false"
android:icon="@drawable/app_icon"
android:label="@string/app_app_name"
tools:ignore="GoogleAppIndexingWarning"
tools:replace="android:icon,android:theme,android:label,android:allowBackup">
本来 replace
是用于合并清单文件时替换依赖库或子模块中的配置的,但是这里因为没有指定 theme
,所以替换时就会因找不到 theme 而报错。
修改方式当然相应的有两种,一种是指定 theme,另一种是不替换 theme。
使用 gradlew 命令调试构建过程
gradlew 命令可配置的参数
执行【gradlew --help】命令可获取 gradlew 命令可配置的参数
USAGE: gradlew [option...] [task...]
-?, -h, --help Shows this help message.
-a, --no-rebuild Do not rebuild project dependencies. [deprecated]
-b, --build-file Specify the build file.
--build-cache Enables the Gradle build cache. Gradle will try to reuse outputs from previous builds. [incubating]
-c, --settings-file Specify the settings file.
--configure-on-demand Configure necessary projects only. Gradle will attempt to reduce configuration time for large multi-project builds. [incubating]
--console Specifies which type of console output to generate. Values are 'plain', 'auto' (default), 'rich' or 'verbose'.
--continue Continue task execution after a task failure.
-D, --system-prop Set system property of the JVM (e.g. -Dmyprop=myvalue).
-d, --debug Log in debug mode (includes normal stacktrace).
--daemon Uses the Gradle Daemon to run the build. Starts the Daemon if not running.
--foreground Starts the Gradle Daemon in the foreground. [incubating]
-g, --gradle-user-home Specifies the gradle user home directory.
-I, --init-script Specify an initialization script.
-i, --info Set log level to info.
--include-build Include the specified build in the composite. [incubating]
-m, --dry-run Run the builds with all task actions disabled.
--max-workers Configure the number of concurrent workers Gradle is allowed to use. [incubating]
--no-build-cache Disables the Gradle build cache. [incubating]
--no-configure-on-demand Disables the use of configuration on demand. [incubating]
--no-daemon Do not use the Gradle daemon to run the build. Useful occasionally if you have configured Gradle to always run with the daemon by default.
--no-parallel Disables parallel execution to build projects. [incubating]
--no-scan Disables the creation of a build scan. For more information about build scans, please visit https://gradle.com/build-scans. [incubating]
--offline Execute the build without accessing network resources.
-P, --project-prop Set project property for the build script (e.g. -Pmyprop=myvalue).
-p, --project-dir Specifies the start directory for Gradle. Defaults to current directory.
--parallel Build projects in parallel. Gradle will attempt to determine the optimal number of executor threads to use. [incubating]
--profile Profile build execution time and generates a report in the <build_dir>/reports/profile directory.
--project-cache-dir Specify the project-specific cache directory. Defaults to .gradle in the root project directory.
-q, --quiet Log errors only.
--recompile-scripts Force build script recompiling. [deprecated]
--refresh-dependencies Refresh the state of dependencies.
--rerun-tasks Ignore previously cached task results.
-S, --full-stacktrace Print out the full (very verbose) stacktrace for all exceptions.
-s, --stacktrace Print out the stacktrace for all exceptions.
--scan Creates a build scan. Gradle will emit a warning if the build scan plugin has not been applied. (https://gradle.com/build-scans) [incubating]
--status Shows status of running and recently stopped Gradle Daemon(s).
--stop Stops the Gradle Daemon if it is running.
-t, --continuous Enables continuous build. Gradle does not exit and will re-execute tasks when task file inputs change. [incubating]
-u, --no-search-upward Don't search in parent folders for a settings file.
-v, --version Print version info.
-w, --warn Set log level to warn.
-x, --exclude-task Specify a task to be excluded from execution.
获取所有 task
执行【gradlew tasks】命令可获取所有 task
To see all tasks and more detail, run gradlew tasks --all
To see more detail about a task, run gradlew help --task
> Task :tasks
------------------------------------------------------------
All tasks runnable from root project
------------------------------------------------------------
Android tasks
-------------
androidDependencies - Displays the Android dependencies of the project.
signingReport - Displays the signing info for each variant.
sourceSets - Prints out all the source sets defined in this project.
Build tasks
-----------
assemble - Assembles all variants of all applications and secondary packages.
assembleAndroidTest - Assembles all the Test applications.
assembleDebug - Assembles all Debug builds.
assembleRelease - Assembles all Release builds.
build - Assembles and tests this project.
buildDependents - Assembles and tests this project and all projects that depend on it.
buildNeeded - Assembles and tests this project and all projects it depends on.
clean - Deletes the build directory.
cleanBuildCache - Deletes the build cache directory.
compileDebugAndroidTestSources
compileDebugSources
compileDebugUnitTestSources
compileReleaseSources
compileReleaseUnitTestSources
mockableAndroidJar - Creates a version of android.jar that's suitable for unit tests.
Build Setup tasks
-----------------
init - Initializes a new Gradle build.
wrapper - Generates Gradle wrapper files.
Help tasks
----------
buildEnvironment - Displays all buildscript dependencies declared in root project 'RxJavaDemo'.
components - Displays the components produced by root project 'RxJavaDemo'. [incubating]
dependencies - Displays all dependencies declared in root project 'RxJavaDemo'.
dependencyInsight - Displays the insight into a specific dependency in root project 'RxJavaDemo'.
dependentComponents - Displays the dependent components of components in root project 'RxJavaDemo'. [incubating]
help - Displays a help message.
model - Displays the configuration model of root project 'RxJavaDemo'. [incubating]
projects - Displays the sub-projects of root project 'RxJavaDemo'.
properties - Displays the properties of root project 'RxJavaDemo'.
tasks - Displays the tasks runnable from root project 'RxJavaDemo' (some of the displayed tasks may belong to subprojects).
Install tasks
-------------
installDebug - Installs the Debug build.
installDebugAndroidTest - Installs the android (on device) tests for the Debug build.
uninstallAll - Uninstall all applications.
uninstallDebug - Uninstalls the Debug build.
uninstallDebugAndroidTest - Uninstalls the android (on device) tests for the Debug build.
uninstallRelease - Uninstalls the Release build.
Verification tasks
------------------
check - Runs all checks.
connectedAndroidTest - Installs and runs instrumentation tests for all flavors on connected devices.
connectedCheck - Runs all device checks on currently connected devices.
connectedDebugAndroidTest - Installs and runs the tests for debug on connected devices.
deviceAndroidTest - Installs and runs instrumentation tests using all Device Providers.
deviceCheck - Runs all device checks using Device Providers and Test Servers.
lint - Runs lint on all variants.
lintDebug - Runs lint on the Debug build.
lintRelease - Runs lint on the Release build.
lintVitalRelease - Runs lint on just the fatal issues in the release build.
test - Run unit tests for all variants.
testDebugUnitTest - Run unit tests for the debug build.
testReleaseUnitTest - Run unit tests for the release build.
获取 task 执行过程的详细信息
执行【gradlew --help】命令可获取 gradlew 命令可配置的参数
USAGE: gradlew [option...] [task...]
-?, -h, --help Shows this help message.
-a, --no-rebuild Do not rebuild project dependencies. [deprecated]
-b, --build-file Specify the build file.
--build-cache Enables the Gradle build cache. Gradle will try to reuse outputs from previous builds. [incubating]
-c, --settings-file Specify the settings file.
--configure-on-demand Configure necessary projects only. Gradle will attempt to reduce configuration time for large multi-project builds. [incubating]
--console Specifies which type of console output to generate. Values are 'plain', 'auto' (default), 'rich' or 'verbose'.
--continue Continue task execution after a task failure.
-D, --system-prop Set system property of the JVM (e.g. -Dmyprop=myvalue).
-d, --debug Log in debug mode (includes normal stacktrace).
--daemon Uses the Gradle Daemon to run the build. Starts the Daemon if not running.
--foreground Starts the Gradle Daemon in the foreground. [incubating]
-g, --gradle-user-home Specifies the gradle user home directory.
-I, --init-script Specify an initialization script.
-i, --info Set log level to info.
--include-build Include the specified build in the composite. [incubating]
-m, --dry-run Run the builds with all task actions disabled.
--max-workers Configure the number of concurrent workers Gradle is allowed to use. [incubating]
--no-build-cache Disables the Gradle build cache. [incubating]
--no-configure-on-demand Disables the use of configuration on demand. [incubating]
--no-daemon Do not use the Gradle daemon to run the build. Useful occasionally if you have configured Gradle to always run with the daemon by default.
--no-parallel Disables parallel execution to build projects. [incubating]
--no-scan Disables the creation of a build scan. For more information about build scans, please visit https://gradle.com/build-scans. [incubating]
--offline Execute the build without accessing network resources.
-P, --project-prop Set project property for the build script (e.g. -Pmyprop=myvalue).
-p, --project-dir Specifies the start directory for Gradle. Defaults to current directory.
--parallel Build projects in parallel. Gradle will attempt to determine the optimal number of executor threads to use. [incubating]
--profile Profile build execution time and generates a report in the <build_dir>/reports/profile directory.
--project-cache-dir Specify the project-specific cache directory. Defaults to .gradle in the root project directory.
-q, --quiet Log errors only.
--recompile-scripts Force build script recompiling. [deprecated]
--refresh-dependencies Refresh the state of dependencies.
--rerun-tasks Ignore previously cached task results.
-S, --full-stacktrace Print out the full (very verbose) stacktrace for all exceptions.
-s, --stacktrace Print out the stacktrace for all exceptions.
--scan Creates a build scan. Gradle will emit a warning if the build scan plugin has not been applied. (https://gradle.com/build-scans) [incubating]
--status Shows status of running and recently stopped Gradle Daemon(s).
--stop Stops the Gradle Daemon if it is running.
-t, --continuous Enables continuous build. Gradle does not exit and will re-execute tasks when task file inputs change. [incubating]
-u, --no-search-upward Don't search in parent folders for a settings file.
-v, --version Print version info.
-w, --warn Set log level to warn.
-x, --exclude-task Specify a task to be excluded from execution.
执行【gradlew tasks】命令可获取所有 task
To see all tasks and more detail, run gradlew tasks --all
To see more detail about a task, run gradlew help --task
> Task :tasks
------------------------------------------------------------
All tasks runnable from root project
------------------------------------------------------------
Android tasks
-------------
androidDependencies - Displays the Android dependencies of the project.
signingReport - Displays the signing info for each variant.
sourceSets - Prints out all the source sets defined in this project.
Build tasks
-----------
assemble - Assembles all variants of all applications and secondary packages.
assembleAndroidTest - Assembles all the Test applications.
assembleDebug - Assembles all Debug builds.
assembleRelease - Assembles all Release builds.
build - Assembles and tests this project.
buildDependents - Assembles and tests this project and all projects that depend on it.
buildNeeded - Assembles and tests this project and all projects it depends on.
clean - Deletes the build directory.
cleanBuildCache - Deletes the build cache directory.
compileDebugAndroidTestSources
compileDebugSources
compileDebugUnitTestSources
compileReleaseSources
compileReleaseUnitTestSources
mockableAndroidJar - Creates a version of android.jar that's suitable for unit tests.
Build Setup tasks
-----------------
init - Initializes a new Gradle build.
wrapper - Generates Gradle wrapper files.
Help tasks
----------
buildEnvironment - Displays all buildscript dependencies declared in root project 'RxJavaDemo'.
components - Displays the components produced by root project 'RxJavaDemo'. [incubating]
dependencies - Displays all dependencies declared in root project 'RxJavaDemo'.
dependencyInsight - Displays the insight into a specific dependency in root project 'RxJavaDemo'.
dependentComponents - Displays the dependent components of components in root project 'RxJavaDemo'. [incubating]
help - Displays a help message.
model - Displays the configuration model of root project 'RxJavaDemo'. [incubating]
projects - Displays the sub-projects of root project 'RxJavaDemo'.
properties - Displays the properties of root project 'RxJavaDemo'.
tasks - Displays the tasks runnable from root project 'RxJavaDemo' (some of the displayed tasks may belong to subprojects).
Install tasks
-------------
installDebug - Installs the Debug build.
installDebugAndroidTest - Installs the android (on device) tests for the Debug build.
uninstallAll - Uninstall all applications.
uninstallDebug - Uninstalls the Debug build.
uninstallDebugAndroidTest - Uninstalls the android (on device) tests for the Debug build.
uninstallRelease - Uninstalls the Release build.
Verification tasks
------------------
check - Runs all checks.
connectedAndroidTest - Installs and runs instrumentation tests for all flavors on connected devices.
connectedCheck - Runs all device checks on currently connected devices.
connectedDebugAndroidTest - Installs and runs the tests for debug on connected devices.
deviceAndroidTest - Installs and runs instrumentation tests using all Device Providers.
deviceCheck - Runs all device checks using Device Providers and Test Servers.
lint - Runs lint on all variants.
lintDebug - Runs lint on the Debug build.
lintRelease - Runs lint on the Release build.
lintVitalRelease - Runs lint on just the fatal issues in the release build.
test - Run unit tests for all variants.
testDebugUnitTest - Run unit tests for the debug build.
testReleaseUnitTest - Run unit tests for the release build.
可以使用以下几个参数中的一个【--stacktrace】【--info】【--debug】【--scan】
例如【gradlew assembleDebug --stacktrace】可以获取 build 过程的详细信息
例如【gradlew processDebugManifest --stacktrace】可以获取 Manifest 检查、合并过程的详细信息
一般用来处理在build时报错但有没有提示具体是什么错时使用,根据经验,通过这种方式基本能获取非常精确的错误信息。
第一次使用(并非是整个PC环境的第一次使用,往往是你AS每次启动后的第一次使用)的时候可能非常慢,因为需要下载大量的文件,不过一般都是正常下载的,应该很少出现下一半下载失败的问题。
2018-8-20
gradlew 命令行 build 调试 构建错误 Manifest merger failed MD的更多相关文章
- AS错误:Manifest merger failed with multiple errors, see logs
gradlew processDebugManifest --stacktrace 在as命令行输入 回车看到 往上滑, 就能看到错误的详细信息,图中这个错误应该不是我原来的错误,是因为我按照网上的方 ...
- (转)Unity3D命令行Build
转自:http://www.cnblogs.com/gameprogram/archive/2012/05/11/2496303.html 本来是没想用这个命令行Build方式,可惜电脑不知道怎么的就 ...
- Unity3D命令行Build
转自:http://www.cnblogs.com/gameprogram/archive/2012/05/11/2496303.html 本来是没想用这个命令行Build方式,可惜电脑不知道怎么的就 ...
- 无法从命令行或调试器启动服务,必须首先安装Windows服务(使用installutil.exe),然后用ServerExplorer、Windows服务器管理工具或NET START命令启动它
无法从命令行或调试器启动服务,必须首先安装Windows服务(使用installutil.exe),然后用ServerExplorer.Windows服务器管理工具或NET START命令启动它 1. ...
- 错误:“Manifest merger failed with multiple errors, see logs”
今天用Android Studio打开以前写个的项目后,出现如下错误:Manifest merger failed with multiple errors, see logs 现象是: 遇到这个问 ...
- android开发里跳过的坑——android studio 错误Error:Execution failed for task ':processDebugManifest'. > Manifest merger failed with multiple errors, see logs
使用AS在gradle里配置了多个定制版本,发现在编译版本切换时,会出现错误: Error:Execution failed for task ':processDebugManifest'.> ...
- Manifest merger failed : uses-sdk:minSdkVersion 9 cannot be smaller than version 10 declared in library
Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed : uses-sdk: ...
- Manifest merger failed : Attribute application@icon value=(@mipmap/ic_launcher) from AndroidManifest
情况是这样子的,导入一个比较老的项目(两年前),它依赖于一个 Libraray,已经先导入了 library,现在导入项目的时候出了错 (1) Android Studio 目前提供将 SDK包成 . ...
- android studio - Manifest merger failed with multiple errors, see logs
今天编译运行的时候遇到了“Error:Execution failed for task ':test:processDebugManifest'.> Manifest merger faile ...
随机推荐
- Web大前端面试题-Day1
1. var的变量提升的底层原理是什么? JS引擎的工作方式是:1) 先解析代码,获取所有被声明的变量:2)然后在运行.也就是说分为预处理和执行两个阶段. 变量提升:所有变量的声明语句都会被提升到代码 ...
- 试图(View)
试图是通过命名约定与动作方法想关联的.这个动作方法称为Index,控制器名称为Home; 添加试图,试图名与该试图相关联的动作方法的名称一致.
- HDU3693 Math Teacher's Homework ---- 数位DP
HDU3693 Math Teacher's Homework 一句话题意 给定$n, k以及m_1, m_2, m_3, ..., m_n$求$x_1 \oplus x_2 \oplus x_3 \ ...
- android 设置为系统应用
韩梦飞沙 韩亚飞 313134555@qq.com yue31313 han_meng_fei_sha 将一个应用apk放到手机的 /系统/应用 这个目录下, 就会是 系统应用.
- NOIP练习赛题目1
有些题目可能没做,如计算几何.恶心模拟. 高级打字机 难度级别:C: 运行时间限制:1000ms: 运行空间限制:51200KB: 代码长度限制:2000000B 试题描述 早苗入手了最新的高级打字机 ...
- 2018年牛客网NOIP赛前训练营游记
2018年牛客网NOIP赛前训练营游记 提高组(第一场) 中位数 #include<cstdio> #include<cctype> #include<climits&g ...
- 微信支付回调取不到body体中的信息node.js
因为支付回调返回的数据格式为XML数据格式,需要安装组件body-parser-xml 安装语法: npm install body-parser-xml --save 在app.js 文件中引入 ...
- Oracle数据库日期范围查询的两种实现方式
参考文档:http://database.51cto.com/art/201108/288058.htm Oracle数据库日期范围查询有两种方式:to_char方式和to_date方式,接下来我们通 ...
- [廖雪峰] Git 分支管理(1):创建与合并分支(HEAD、master、dev、指针)
每次提交,Git 都把它们串成一条时间线,这条时间线就是一个分支.截止到目前,只有一条时间线,在 Git 里,这个分支叫主分支,即 master 分支.HEAD 严格来说不是指向提交,而是指向 mas ...
- Revit Family API 添加对齐
没测试成功,留待以后研究. [TransactionAttribute(Autodesk.Revit.Attributes.TransactionMode.Manual)] ; ; i < nV ...