hbx版本是4.36
鸿蒙设备是虚拟机
点击运行到鸿蒙设备,出现报错
hvigor ERROR: Invalid product for target 'default'.
Detail: Check the target applyToProducts field for 'default': [ 'default', 'release' ].
at D:\pengli_zhaobiao\pengli_zb_2.0\unpackage\debug\app-harmony-26d8f534\build-profile.json5
hvigor ERROR: BUILD FAILED in 2 s 92 ms
10:47:41.048 运行包制作失败
我在harmony-configs自己先了一个build-profile.json5文件里面的信息如下:
{
"app": {
"signingConfigs": [
{
"name": "default",
"type": "HarmonyOS",
"material": {
"storePassword": "0000001BC209C0AA09655E368890E4507C7913979D71C912C35933668CCE78163974F596D9F798AA4B7769",
"certpath": "D:/pengli_zhaobiao/00必要文件/鸿蒙证书/调试/penglizb_dev.cer",
"keyAlias": "penglizb",
"keyPassword": "0000001BA9E7E44003EA9DA192852B5C690ECE8ADF9517B2D0A19C969C35B3D30BF13164119B8412D35185",
"profile": "D:/pengli_zhaobiao/00必要文件/鸿蒙证书/调试/penglizb_devDebug.p7b",
"signAlg": "SHA256withECDSA",
"storeFile": "G:/04pengli_java/pengli_zhaobiao/00必要文件/鸿蒙证书/penglizb.p12"
}
},
{
"name": "release",
"type": "HarmonyOS",
"material": {
"storePassword": "0000001BC209C0AA09655E368890E4507C7913979D71C912C35933668CCE78163974F596D9F798AA4B7769",
"certpath": "D:/pengli_zhaobiao/00必要文件/鸿蒙证书/penglizb_pro.cer",
"keyAlias": "penglizb",
"keyPassword": "0000001BA9E7E44003EA9DA192852B5C690ECE8ADF9517B2D0A19C969C35B3D30BF13164119B8412D35185",
"profile": "D:/pengli_zhaobiao/00必要文件/鸿蒙证书/penglizb_proRelease.p7b",
"signAlg": "SHA256withECDSA",
"storeFile": "G:/04pengli_java/pengli_zhaobiao/00必要文件/鸿蒙证书/penglizb.p12"
}
}
],
"products": [
{
"name": "default",
"signingConfig": "default",
"compatibleSdkVersion": "5.0.0(12)",
"runtimeOS": "HarmonyOS"
}
]
}
}
- 如果不要该配置的话,会提示证书不存在,但是可以运行到鸿蒙模拟器上面,但是app点击就闪退了,不知道在哪里看日志.
- 目前在hbx自带浏览器运行是正常的.
3 个回复
liandyao (作者)
在DevEco里面可以查看日志了
[GetNativeTokenInfo:240]TokenID =537790108 is invalid
12-12 10:55:06.235 1170-1189 C01406/OHOS::RS com.ohos.sceneboard I RSUIDirector::ProcessMessages messageId:205, cmdCount:14, instanceId:100000
12-12 10:55:06.235 1170-1170 C01406/OHOS::RS com.ohos.sceneboard I RSUIDirector::PostTask messageId:205, cmdCount:14, instanceId:100000
12-12 10:55:06.235 1170-1170 C03930/AceAnimation com.ohos.sceneboard I [(100000:100000:scope)] animateTo finish, cnt:111
12-12 10:55:06.235 1170-1170 A01b01/HOME com.ohos.sceneboard I SCBScenePanel --> begin screen rotate policy landscape start sync Flag:false landscapeStartRotation:0 currentRotation:0 scenePanelRotation:0 scenePanelState:1
12-12 10:55:06.235 1170-1642 C05a01/AccessTokenKit com.ohos.sceneboard E [GetNativeTokenInfo:240]TokenID =537790108 is invalid
12-12 10:55:06.235 1170-1642 C04200/WMS com.ohos.sceneboard E [scene_session.cpp] UpdateSessionPropertyByAction<3023>: permission denied! action: 262144
不知道这个是不是没有证书的原因,出现闪退
liandyao (作者)
@DCloud_UNI_yuhe 麻烦帮我看看,谢谢了
liandyao (作者)
打包的问题解决了,这个帖子有答案: https://ask.dcloud.net.cn/question/201483
现在还是在鸿蒙模拟器运行闪退的问题
[GetNativeTokenInfo:240]TokenID =536876678 is invalid
12-12 21:11:48.240 1208-1528 C04208/WMSLayout com.ohos.sceneboard I [scene_session.cpp] HandleActionUpdateWindowLimits<3336>: UpdateWindowLimits minWidth:1040, minHeight:780, maxWidth:6240, maxHeight:6240, vpRatio:3.250000
12-12 21:11:48.240 1208-1219 C05a01/AccessTokenKit com.ohos.sceneboard E [GetNativeTokenInfo:240]TokenID =536876678 is invalid
12-12 21:11:48.240 1208-1219 C04200/WMS com.ohos.sceneboard E [scene_session.cpp] UpdateSessionPropertyByAction<3023>: permission denied! action: 2048
12-12 21:11:48.241 1208-1219 C05a01/AccessTokenKit com.ohos.sceneboard E [GetNativeTokenInfo:240]TokenID =536876678 is invalid
12-12 21:11:48.241 1208-1208 C01406/OHOS::RS com.ohos.sceneboard I RSNode::AddChild, Id: 5188320494620, SurfaceNode:[Id: 33801392619521, name: zb0]
12-12 21:11:48.242 1208-1528 C04208/WMSLayout com.ohos.sceneboard I [scene_session.cpp] operator()<621>: position change no need notify client id:45, rect:[0 0 1260 2720], preRect: [0 0 1260 2720]
12-12 21:11:48.242 1208-1208 A04200/WINDOW com.ohos.sceneboard I SCBSceneSession --> [SCBImms]on systemBarPropertyChange persistentId:45
12-12 21:11:48.242 1208-1208 A04200/WINDOW com.ohos.sceneboard I SCBSceneSession --> [SCBImms]on systemBarPropertyChange property, type:30, enable:true, backgroundcolor:#00FFFFFF, contentcolor:#FF000000, enableAnimation:false, settingFlag:0
12-12 21:11:48.243 1208-1208 A04200/WINDOW com.ohos.sceneboard I SCBSceneSession --> [SCBImms]on systemBarPropertyChange property, type:9, enable:true, backgroundcolor:#00FFFFFF, contentcolor:#FF000000, enableAnimation:false, settingFlag:0
12-12 21:11:48.243 1208-1208 A04200/WINDOW com.ohos.sceneboard I SCBSceneSession --> [SCBImms]on systemBarPropertyChange property, type:5, enable:true, backgroundcolor:#00FFFFFF, contentcolor:#FF000000, enableAnimation:false, settingFlag:4
12-12 21:11:48.243 1208-1208 A04200/WINDOW com.ohos.sceneboard I SCBSceneSessionManager --> [SCBImms]updateSystemBarProperty
12-12 21:11:48.246 1208-1219 C05a01/AccessTokenKit com.ohos.sceneboard E [GetNativeTokenInfo:240]TokenID =536876678 is invalid