zl程序教程

您现在的位置是:首页 >  移动开发

当前栏目

:app:processDebugMainManifest Manifest merger failed with multiple errors, see logs

AppFailed with multiple errors Logs MANIFEST See
2023-09-14 09:14:00 时间

android studio的报错提示:

......
:app:processDebugMainManifest
Manifest merger failed with multiple errors, see logs

:app:processDebugMainManifest对应:
在这里插入图片描述

> Task :app:processDebugMainManifest FAILED
D:\Android2\CityList1\app\src\main\AndroidManifest.xml:20:5-81 Warning:
	Element uses-permission#android.permission.WRITE_EXTERNAL_STORAGE at AndroidManifest.xml:20:5-81 duplicated with element declared at AndroidManifest.xml:11:5-81
D:\Android2\CityList1\app\src\main\AndroidManifest.xml:8:5-10:41 Error:
	uses-sdk:minSdkVersion 8 cannot be smaller than version 9 declared in library [com.android.support:appcompat-v7:25.0.1] C:\Users\Administrator\.gradle\wrapper\dists\gradle-6.7.1-all\caches\transforms-2\files-2.1\c7595eb13b704f08e6092b7e9dcde643\appcompat-v7-25.0.1\AndroidManifest.xml as the library might be using APIs not available in 8
	Suggestion: use a compatible library with a minSdk of at most 8,
		or increase this project's minSdk version to at least 9,
		or use tools:overrideLibrary="android.support.v7.appcompat" to force usage (may lead to runtime failures)

See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.


Execution failed for task ':app:processDebugMainManifest'.
> 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.

错误到底在哪,可以发现:
:app:processDebugMainManifest对应的中一句:

D:\Android2\CityList1\app\src\main\AndroidManifest.xml:8:5-10:41 Error:
	uses-sdk:minSdkVersion 8 cannot be smaller than version 9 declared in library 

这报错信息中AndroidManifest.xml,只记得要在AndroidManifest点击“Merged Manifest”
在这里插入图片描述
Merged Manifest中发现一个小问题,报错信息如下图:
在这里插入图片描述
问题我容易找到了,按照这种方法就可以很轻松的找到冲突的错误所在

Error: uses-sdk:minSdkVersion 8 cannot be smaller than version 9 declared in library怎么解决:
1.直接删除(不一定)如下图:
在这里插入图片描述
看一下:
uses-sdk:minSdkVersion 8 cannot be smaller than version 9 declared in library [com.android.support:appcompat-v7:25.0.1] C:\Users\Administrator.gradle\wrapper\dists\gradle-6.7.1-all\caches\transforms-2\files-2.1\c7595eb13b704f08e6092b7e9dcde643\appcompat-v7-25.0.1\AndroidManifest.xml as the library might be using APIs not available in 8
可能app的build.gradle中的minSdkVersion有问题:

minSdkVersion 8

minSdkVersion 8的8好像不存在
解决:
改minSdkVersion多少(多少必须有存在)