android uses-sdk:minSdkVersion 19不能小于库中声明的version 21

z6psavjg  于 2023-06-20  发布在  Android
关注(0)|答案(1)|浏览(308)

我最近升级了Cordova-Android到版本12,我的应用程序不再构建,我得到以下错误
uses-sdk:minSdkVersion 19不能小于库中声明的version 21
我知道我需要将我的最小版本提高到21或更高,我已经在我的config.xml文件中完成了:-

  1. <platform name="android">
  2. ...
  3. <preference name="android-minSdkVersion" value="24" />
  4. ...
  5. </platform>

我已经删除和添加平台无数次,我仍然得到一个失败的建设与上述错误。我在谷歌上搜索的所有内容都以相同的答案结束(在config.xml文件中更改android-minSdkVersion版本)。
我拉我的头发,因为我相信这是一些明显的我错过了,感谢任何帮助,如果你需要更多的信息(插件使用等,然后让我知道)。
完整错误:

  1. > Task :app:processDebugMainManifest FAILED
  2. C:\www\cordova\app\platforms\android\app\src\main\AndroidManifest.xml Error:
  3. uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library [androidx.core:core-splashscreen:1.0.0] C:\Users\user\.gradle\caches\transforms-3\8fa35d5508191c4f9f8ca09de1273d1b\transformed\jetified-core-splashscreen-1.0.0\AndroidManifest.xml as the library might be using APIs not available in 19
  4. Suggestion: use a compatible library with a minSdk of at most 19,
  5. or increase this project's minSdk version to at least 21,
  6. or use tools:overrideLibrary="androidx.core.splashscreen" to force usage (may lead to runtime failures)
  7. See https://developer.android.com/r/studio-ui/build/manifest-merger for more information about the manifest merger.
  8. FAILURE: Build failed with an exception.
  9. * What went wrong:
  10. Execution failed for task ':app:processDebugMainManifest'.
  11. > Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library [androidx.core:core-splashscreen:1.0.0] C:\Users\user\.gradle\caches\transforms-3\8fa35d5508191c4f9f8ca09de1273d1b\transformed\jetified-core-splashscreen-1.0.0\AndroidManifest.xml as the library might be using APIs not available in 19
  12. Suggestion: use a compatible library with a minSdk of at most 19,
  13. or increase this project's minSdk version to at least 21,
  14. or use tools:overrideLibrary="androidx.core.splashscreen" to force usage (may lead to runtime failures)
tag5nh1u

tag5nh1u1#

您可能已经在gradle构建配置中设置了最小sdk版本。请参阅https://developer.android.com/build/gradle-tips#combine-multiple-product-flavors,其中显示了在gradle文件中使用minSdkVersion

相关问题