Solution to error when importing sample project: failed to start ability. Error while Launching activity

Import the Huawei Healthy Lifestyle App (ArkTS) , DevEco Studioopen it, and run it to report an error:

error: failed to start ability. 
Error while Launching activity

Insert image description here
Solution: Modify the value module.json5inside exported, from falsetotrue

"exported": true,

Insert image description here

It can run normally:

Insert image description here

Check module.json5the configuration file description, the correct exporteddescription is as follows:

Insert image description here

When the set value falseis , it cannot be called by other applications, so an error occurs.

Refer to Huawei Forum:

https://developer.huawei.com/consumer/cn/forum/topic/0204126532204858364

Guess you like

Origin blog.csdn.net/SSY_1992/article/details/132230743