在pages.json 中使用了subNvues:
{
"path": "pages/tabBar/home/home",
"style": {
"navigationBarTitleText": "首页",
"app-plus": {
"titleNView": false,
"subNVues": [{
"id": "homeTitleNvue",
"path": "pages/tabBar/home/subNVue/homeTitle",
"type": "navigationBar"
}]
}
}
}
报错信息如下:
21:54:16.663 reportJSException >>>> exception function:callCreateBody, exception:java.lang.NullPointerException: Attempt to invoke virtual method 'com.taobao.weex.dom.WXAttr com.taobao.weex.ui.component.WXComponent.getAttrs()' on a null object reference
21:54:16.686 at com.taobao.weex.ui.RenderContextImpl.registerComponent(RenderContextImpl.java:86)
21:54:16.705 at com.taobao.weex.ui.WXRenderManager.registerComponent(WXRenderManager.java:306)
21:54:16.726 at com.taobao.weex.ui.action.GraphicActionAbstractAddElement.createComponent(GraphicActionAbstractAddElement.java:62)
21:54:16.745 at com.taobao.weex.ui.action.GraphicActionCreateBody.<init>(GraphicActionCreateBody.java:61)
21:54:16.767 at com.taobao.weex.bridge.WXBridgeManager.callCreateBody(WXBridgeManager.java:2758)
21:54:16.788 at com.taobao.weex.bridge.WXBridge.callCreateBody(WXBridge.java:516)
21:54:16.808 at com.taobao.weex.base.SystemMessageHandler.nativeRunWork(Native Method)
21:54:16.828 at com.taobao.weex.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:104)
21:54:16.849 at android.os.Handler.dispatchMessage(Handler.java:102)
21:54:16.869 at android.os.Looper.loop(Looper.java:148)
21:54:16.889 at android.os.HandlerThread.run(HandlerThread.java:61)
把pages.json中那段注释掉就不会报错,请问有人知道这是什么原因吗?
5 个回复
mrjames
检查一下你的容器标签,不能写header等标签
2***@qq.com
解决了吗? 我也报这个错误
安静旅途
同问,这个问题网上没有方法,对于新手很是崩溃
mrjames
跪求同问
8***@qq.com
不用header标签,改为div标签,就不会报错