[英]Has anybody successfully upgraded your ionic cordova Hybrid app from android version 9.x to android Cordova version 10.x
Im trying to upgrade the Android cordova version of the app from v9 to v10.我正在尝试将应用程序的 Android 科尔多瓦版本从 v9 升级到 v10。 But Im facing build issues.Has anybody else facing the same issue.
但我面临构建问题。有没有其他人面临同样的问题。 I already tried and applied the prerequisites needed from this link https://cordova.apache.org/announcements/2021/07/20/cordova-android-10.0.0.html
我已经尝试并应用了此链接所需的先决条件https://cordova.apache.org/announcements/2021/07/20/cordova-android-10.0.0.html
Please input your ideas.请输入您的想法。
There is one version up, 10.1.0 which fixed some issue.有一个版本,10.1.0 修复了一些问题。 Try out this one for the beginning
一开始就试试这个
Try these Steps to update your app:尝试以下步骤来更新您的应用:
Step 1): Remove whitelist plugin: ionic cordova plugin rm cordova-plugin-whitelist
步骤 1): 删除白名单插件:
ionic cordova plugin rm cordova-plugin-whitelist
Step 2): add android x plugin: ionic cordova plugin add cordova-plugin-androidx
步骤 2): 添加 android x 插件:
ionic cordova plugin add cordova-plugin-androidx
step3): add adnroid x adapter: ionic cordova plugin add cordova-plugin-androidx-adapter
step3): 添加 adnroid x 适配器:
ionic cordova plugin add cordova-plugin-androidx-adapter
these will solve your migration issues.这些将解决您的迁移问题。
From what I have tried, seems like从我尝试过的来看,似乎
cordavo-plugin-androidx
is not required anymore since it does not support cordova-andriod
: 10 and above.不再需要
cordavo-plugin-androidx
,因为它不支持cordova-andriod
: 10 及更高版本。
Removing the cordova-plugin-whitelist
and adding the cordova-plugin-androidx-adapter
would suffice.删除
cordova-plugin-whitelist
并添加cordova-plugin-androidx-adapter
就足够了。
I am currently on cordova-android: 10.1.1.我目前在cordova-android上:10.1.1。
If you are using local storage to save data, ie cordova-sqlite-storage
, be sure to update it to 6.0.0 and add this line in your config.xml
for migration of localstorage data in your app from API 29 -> API 30
.如果您使用本地存储来保存数据,即
cordova-sqlite-storage
,请确保将其更新为 6.0.0 并在您的config.xml
添加这一行,以便从API 29 -> API 30
迁移您的应用程序中的本地存储数据.
Uninstall: ionic cordova plugin rm cordova-sqlite-storage
卸载:
ionic cordova plugin rm cordova-sqlite-storage
Install: ionic cordova plugin add cordova-sqlite-storage@6.0.0
安装:
ionic cordova plugin add cordova-sqlite-storage@6.0.0
Install node package: npm i cordova-sqlite-storage@6.0.0
安装节点包:
npm i cordova-sqlite-storage@6.0.0
<preference name="AndroidInsecureFileModeEnabled" value="true" />
Last word, be sure to update your android studio SDK to support 30.0.3
as well, if not you might run into some build error.最后一句话,请务必更新您的 android studio SDK 以支持
30.0.3
,否则您可能会遇到一些构建错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.