问题:
log如下:
[androidx.test:runner:1.4.0] C:\Users\xueye\.gradle\caches\transforms-2\files-2.1\cfeaf27d3ef021391bd03f9b1ac267fe\AndroidManifest.xml:25:9-62 Error:
Missing 'package' key attribute on element package at [androidx.test:runner:1.4.0] AndroidManifest.xml:25:9-62
[androidx.test:runner:1.4.0] C:\Users\xueye\.gradle\caches\transforms-2\files-2.1\cfeaf27d3ef021391bd03f9b1ac267fe\AndroidManifest.xml:26:9-58 Error:
Missing 'package' key attribute on element package at [androidx.test:runner:1.4.0] AndroidManifest.xml:26:9-58
[androidx.test:runner:1.4.0] C:\Users\xueye\.gradle\caches\transforms-2\files-2.1\cfeaf27d3ef021391bd03f9b1ac267fe\AndroidManifest.xml:27:9-83 Error:
Missing 'package' key attribute on element package at [androidx.test:runner:1.4.0] AndroidManifest.xml:27:9-83
[androidx.test:runner:1.4.0] C:\Users\xueye\.gradle\caches\transforms-2\files-2.1\cfeaf27d3ef021391bd03f9b1ac267fe\AndroidManifest.xml Error:
Validation failed, exiting
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugAndroidTestManifest'.
> Manifest merger failed with multiple errors, see logs
* Try:
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.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 4s
7 actionable tasks: 3 executed, 4 up-to-date
ERROR: Manifest merger failed with multiple errors, see logs
解决方案:
找一个之前在AS中build通过的项目的build.gradle文件---->复制其dependencies中的各版本信息到出问题的项目---->点击Sync Now重新build项目即可