Simulator Shows Black Screen - Page build() Function Not Called #448
obaidr1
started this conversation in
Developer Feedback
Replies: 2 comments 8 replies
-
You use API version v3 yet you also use v1 resources. |
Beta Was this translation helpful? Give feedback.
1 reply
-
thank you. now everything is rendering again. Somehow adding the temp sensor broke everything:
I am developing for the GTR4 |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem Description:
I am developing a new application for Zepp OS, but I am consistently unable to render any UI in the simulator. The screen remains black. Through extensive logging, I've confirmed that the build() function within my page/index.js file is never being executed. Even a console.log() at the top level of the file does not appear in the terminal logs, which suggests the file itself is not being loaded or run by the OS, despite the build process completing successfully.
Troubleshooting Steps Already Taken:
Code Simplification: Reduced the page code to an absolute minimal "Hello World" example.
Configuration Check: Verified that app.json correctly points to "page/index" in the pages array.
Dependency Reset: Deleted node_modules, dist, and package-lock.json, and ran npm install to get a clean slate.
CLI Restart: Have repeatedly stopped and restarted the zeus dev process.
Logging: Added extensive console.log and Logger.log statements, none of which appear in the terminal from the page/index.js file.
Relevant Files:
Here is my app.json file:
{
"configVersion": "v3",
"app": {
"appId": 23548,
"appName": "FertilityTracker",
"appType": "app",
"version": {
"code": 1,
"name": "1.0.0"
},
"icon": "icon.png",
"vender": "zepp",
"description": "Scientific fertility tracking app for Amazfit smartwatches"
},
"permissions": [
"sensor"
],
"runtime": {
"apiVersion": {
"compatible": "3.0.0",
"target": "3.0.0",
"minVersion": "3.0"
}
},
"targets": {
"default": {
"module": {
"page": {
"pages": [
"page/index"
]
},
"app-side": {
"path": "app-side/index"
},
"setting": {
"path": "setting/index"
}
},
"platforms": [
{
"st": "r",
"dw": 480
}
]
}
},
"i18n": {
"en-US": {
"appName": "FertilityTracker"
}
},
"defaultLanguage": "en-US"
}
And here is the final, minimal code for page/index.js that still results in a black screen:
import { ui as hmUI } from '@zos/ui'
// This log is at the top level. It does NOT appear in the terminal.
console.log('--- page/index.js file has been loaded ---');
Page({
build() {
// This log also does not appear.
console.log('--- Build function was called ---');
},
onDestroy() {}
})
Any help or insight into what could be causing this environmental issue would be greatly appreciated. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions