Please help, I have been trying to solve the problem for 2 days. I am writing an application for a lite wearable watch (huawei gt2 pro), the application works on the simulator and preview, but crashes on the device.
index.js
export default {
data: {
dates: [
{id:0, values:[{id:0, day:26}, {id:1, day:27}, {id:2, day:28}, {id:3, day:29}, {id:4, day:30}, {id:5, day:1}, {id:6, day:2}]},
{id:1, values:[{id:0, day:3}, {id:1, day:4}, {id:2, day:5}, {id:3, day:6}, {id:4, day:7}, {id:5, day:8}, {id:6, day:9}]},
{id:2, values:[{id:0, day:10}, {id:1, day:11}, {id:2, day:12}, {id:3, day:13}, {id:4, day:14}, {id:5, day:15}, {id:6, day:16}]},
{id:3, values:[{id:0, day:17}, {id:1, day:18}, {id:2, day:19}, {id:3, day:20}, {id:4, day:21}, {id:5, day:22}, {id:6, day:23}]},
{id:4, values:[{id:0, day:24}, {id:1, day:25}, {id:2, day:26}, {id:3, day:27}, {id:4, day:28}, {id:5, day:29}, {id:6, day:30}]},
{id:5, values:[{id:0, day:31}, {id:1, day:1}, {id:2, day:2}, {id:3, day:3}, {id:4, day:4}, {id:5, day:5}, {id:6, day:6}]},
{id:6, values:[{id:0, day:26}, {id:1, day:27}, {id:2, day:28}, {id:3, day:29}, {id:4, day:30}, {id:5, day:1}, {id:6, day:2}]},
{id:7, values:[{id:0, day:3}, {id:1, day:4}, {id:2, day:5}, {id:3, day:6}, {id:4, day:7}, {id:5, day:8}, {id:6, day:9}]},
{id:8, values:[{id:0, day:10}, {id:1, day:11}, {id:2, day:12}, {id:3, day:13}, {id:4, day:14}, {id:5, day:15}, {id:6, day:16}]},
{id:9, values:[{id:0, day:17}, {id:1, day:18}, {id:2, day:19}, {id:3, day:20}, {id:4, day:21}, {id:5, day:22}, {id:6, day:23}]},
{id:10, values:[{id:0, day:24}, {id:1, day:25}, {id:2, day:26}, {id:3, day:27}, {id:4, day:28}, {id:5, day:29}, {id:6, day:30}]},
{id:11, values:[{id:0, day:31}, {id:1, day:1}, {id:2, day:2}, {id:3, day:3}, {id:4, day:4}, {id:5, day:5}, {id:6, day:6}]},
]
}
}
index.htm
<div class="container">
<div class="dates-container" for="{{ week in dates }}" tid="id">
<div class="dates" for="{{ date in week.values }}" tid="id">
<text class="dates">{{ date.day }}</text>
</div>
</div>
</div>
index.css
.container {
width: 454px;
height: 454px;
justify-content: center;
align-items: center;
flex-direction: column;
}
.dates-container {
width: 454px;
height: 40px;
justify-content: center;
align-items: center;
}
.dates {
display: flex;
font-size: 30px;
text-align: center;
width: 55px;
height: 40px;
border-width: 1px;
border-color: #414343;
color: black;
flex-direction: row;
background-color: aquamarine;
}
If the array is made smaller by 2 times, then everything works on the device. But I do not believe that there is so little memory that it will not be possible to transfer such an array. The profiler shows the minimum memory consumption.
You are advised to replace the IDE of the latest version and check whether the problem persists.
The memory of the Gt2 pro is limited to 48 KB. However, the simulator of the old IDE does not have this limitation, the actual physical device has this limitation. Therefore, when the memory of the Gt2 pro exceeds the limit, the physical device crashes.
In addition, you are advised to optimize the code. The amount of data is too large. In normal tests, it is best to display five pieces of data on each page. If the amount of data is too large, it is easy to crash.