鸿蒙OS应用开发之——新建Ability没有Empty Page Ability
一 现象
当在项目的bundleName上右键,新建Ability时,只有Empty Data Ability
和Empty Service Ability
,没有:Empty Feature Ability(JS)
、Empty Feature Ability(Java)
、List Feature Ability(JS)
二 原因分析
2.1 设备模板不同
不同设备下,模板类别不同
2.2 不同设备下的模板
设备 | 模板 |
---|---|
phone | Empty Data Ability Empty Page Ability(JS) Empty Page Ability(Java) Empty Service Ability |
tablet | Empty Data Ability Empty Page Ability(JS) Empty Page Ability(Java) Empty Service Ability |
tv | Empty Data Ability Empty Page Ability(JS) Empty Page Ability(Java) Empty Service Ability List Feature Ability(JS) |
car | Empty Data Ability Empty Page Ability(Java) Empty Service Ability |
wearable | Empty Data Ability Empty Page Ability(JS) Empty Page Ability(Java) Empty Service Ability List Feature Ability(JS) |
三 deviceType同时设置了phone和tablet如何解决
deviceType同时设置了phone和table时,新建Ability时,只有Empty Data Ability
和Empty Service Ability
,此时可先设置一个如phone
或tablet