DevEco Studio:4.0Release
OpenHarmony SDK API10
开发板:润和DAYU200
目前我们能够看到的是鸿蒙已经到API10,甚至今天在看OpenHarmony官网的时候,4.1beta的分支都已经有了,也就是API11马上就出来了。
这个时候,我们最起码要将API 9工程转换为API 10工程。然后再慢慢的迁移到未来的11上。
接下来我们说一下如何迁移。
1.将工程级build-profile.json5文件中compileSdkVersion和compatibleSdkVersion字段从app下迁移到当前选中的product中。当前生效的product可以通过点击编辑区域右上方图标进行查看。
{
"app": {
"signingConfigs": [
],
"products": [
{
"signingConfig": "default",
"name": "default",
"compileSdkVersion": 10,
"compatibleSdkVersion": 10,
"targetSdkVersion": 10,
"runtimeOS": "OpenHarmony"
}
]
},
"modules": [
{
"srcPath": "./entry",
"name": "entry",
"targets": [
{
"name": "default",
"applyToProducts": [
"default"
]
}
]
},
{
"srcPath": "./common",
"name": "common",
"targets": [
{
"name": "default",
"applyToProducts": [
"default"
]
}
]
}
]
}
2.请将compileSdkVersion和compatibleSdkVersion改为10。同时在当前product下配置targetSdkVersion(若需要)和runtimeOS。
"app": {
"signingConfigs": [],
"products": [
{
"name": "default",
"signingConfig": "default",
"compileSdkVersion": 10, //OpenHarmony/服务编译时的版本
"compatibleSdkVersion":10, //指定OpenHarmony应用/服务兼容的最低版本。
"targetSdkVersion": 10, //指定OpenHarmony应用/服务目标版本。若没有设置,默认为compatibleSdkVersion
"runtimeOS": "OpenHarmony" //指定为OpenHarmony
}
],
3.将其他各模块级别的build-profile.json5文件中target字段下的runtimeOS配置删除。
4.单击Sync Now完成同步。
这样我们就完成迁移了。
是不是很简单。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有