OpenHarmony开发者论坛
标题:
rk3568 OpenHarmony 4.0 screen.getAllScreens函数调用报错
[打印本页]
作者:
18025342273
时间:
2024-3-8 17:22
标题:
rk3568 OpenHarmony 4.0 screen.getAllScreens函数调用报错
[md]```
screen.getAllScreens((err, data) => {
if (err.code) {
console.error('Failed to get all screens. Cause: === ' + JSON
.stringify(err));
return;
}
console.info('Succeeded in getting all screens. Data:===' + JSON.stringify(data));
screenClass = data[0];
screenClass.setOrientation(screen.Orientation.HORIZONTAL, (err) => {
if (err.code) {
console.error('Failed to set the vertical orientation. Code: ===' + JSON.stringify(err));
return;
}
console.info('Succeeded in setting the vertical orientation.===')
});
})
```
使用如上代码,打印报错Failed to get all screens. Cause: === {"code":202},但是不知道在哪里查202报错是什么原因
[/md]
作者:
hyacinth养花人
时间:
2024-3-11 17:04
标题:
rk3568 openHarmony 4.0 screen.getAllScreens函数调用报错
[md]参考[通用错误码](
https://docs.openharmony.cn/page ... rcode-universal.md/
)
screen是系统API
## 202 系统API权限校验失败
**错误信息**
Permission verification failed, application which is not a system application uses system API.
**错误描述**
权限校验失败,非系统应用使用了系统API。
**可能原因**
非系统应用,使用了系统API,请校验是否使用了系统API。
**处理步骤**
请检查是否调用了系统API,并且去掉。
[/md]
欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/)
Powered by Discuz! X3.5