【问题标题】:How to update capacitor to use android project to SDK v30如何更新电容器以使用 android 项目到 SDK v30
【发布时间】:2022-01-18 17:39:13
【问题描述】:

我不确定如何将我的电容器 Android 项目更新为面向 SDK v30。 每次我做rm -rf ./android && ionic capacitor copy android 并编辑build.gradlevariables.grade进行设置

compileSdkVersion = 30
targetSdkVersion = 30

在 Play 商店中上传 apk 失败

Your app currently targets API level 29 and must target at least API level 30 to ensure it is built on the latest APIs optimized for security and performance. Change your app's target API level to at least 30.

我敢打赌我只需要以某种方式更新电容器或使用标志运行它,但只是哪一个?

【问题讨论】:

  • 安装最新电容:npm install @capacitor/core。然后安装最新的android:npm install @capacitor/android 然后添加android npx cap add android

标签: android ionic-framework capacitor ionic5


【解决方案1】:

您是否正在编辑正确的 build.gradle 文件?我相信要编辑的是 build.gradle(Module:android.capacitor-app)。

或者,从文件/项目结构中打开项目属性。然后在变量下,检查你的android(项目)。它应该列出您在那里拥有的版本。我相信这些在我上次检查时是可编辑的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多