HarmonyOS 鸿蒙Next 5.0.0怎么连接到AppGallery Connect云数据库啊
HarmonyOS 鸿蒙Next 5.0.0怎么连接到AppGallery Connect云数据库啊
import { cloudDatabase } from '@kit.CloudFoundationKit';
import { Article } from '../models/Article';
import { BusinessError } from '@kit.BasicServicesKit';
@Entry
@Component
export struct TestPage {
aboutToAppear() {
this.testQuery(); // 页面加载时触发测试查询
}
testQuery() {
let databaseZone = cloudDatabase.zone('Hanmoshuyuan');
if (!databaseZone) {
console.error('Database zone initialization failed.');
return;
}
}
build() {
Column() {
Text('Testing Cloud Database Query...')
.fontSize(20)
.margin(20);
}
}
}
Build info:emulator 5.0.0.112(SP2DEVC00E112R4P11log)
Fingerprint:c9795b1fd981c17103ba8f51a2c0dbfdc14a3cf1c7170129828f46d705c854dc
Module name:com.cugb.hanmoshuyuan
Version:1.0.0
VersionCode:1000000
PreInstalled:No
Foreground:Yes
Pid:9966
Uid:20020043
Reason:TypeError
Error name:TypeError
Error message:Cannot read property zone of undefined
Stacktrace:
at testQuery (entry/src/main/ets/pages/Second.ets:14:24)
at aboutToAppear (entry/src/main/ets/pages/Second.ets:10:5)
更多关于HarmonyOS 鸿蒙Next 5.0.0怎么连接到AppGallery Connect云数据库啊的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html
5 回复
用真机试试,我真机测试这边没报错,但是模拟器会报和你一样的错误
更多关于HarmonyOS 鸿蒙Next 5.0.0怎么连接到AppGallery Connect云数据库啊的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html
感谢老哥
您好,目前仅支持真机。
你们开发文档也不写清楚,我调一下午