我知道这个问题以前有人问过,但似乎在以前的问题中找不到答案,所以这里说一下。
我在Unity中创建了一个项目,并将其导出到Android Studio中。我已经将最小API级别设置为4.4 KitKat(API级别19)。
我在主清单文件中添加了:。当构建时,我得到这个错误。
Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library [:UniWebView:] /Users/myname/.gradle/caches/transforms-2/files-2.1/97563e885486a53e4f6658e98b58f094/jetified-UniWebView/AndroidManifest.xml as the library might be using APIs not available in 19
Suggestion: use a compatible library with a minSdk of at most 19,
or increase this project's minSdk version to at least 21,
or use tools:overrideLibrary="com.onevcat.uniwebview" to force usage (may lead to runtime failures)
如何设置兼容库为minSdk 19?它需要是19,而不是21,因为如果我发布21的更新,几乎20%的用户将无法玩这个游戏:-。
Units not compatible with API level 21+ = 2054 (19%)
事实上... 一个小问题... 我是否应该害怕升级API会失去用户?我有一个使用API等级21的版本,准备发布。
如果我应该小心,如何解决最初的问题?
希望得到帮助,提前感谢:-)
你基本上有4个选项。
tools:overrideLibrary="com.onevcat.uniwebview"
到你的manifests的应用标签,这很可能会导致你的API 19用户的运行时崩溃(如果你选择这个选项,请大量测试整个事情!!!)。如果我是你的话,我会选择第三种方案。