weex navigator 使用不了?

index.vue

var navigator = weex.requireModule('navigator')
jump () {
  navigator.push({
    url: "file://assets/views/login.js",
    animated: "true"
  });
}

android studio 日志报错

01-05 06:41:49.092 17310-17310/com.weex.app W/weex: Warning :Component tree has not build completely,onActivityCreate can not be call!
01-05 06:41:49.092 17310-17310/com.weex.app D/CLog: Warning :Component tree has not build completely,onActivityCreate can not be call!
01-05 06:41:49.122 17310-17310/com.weex.app W/System.err: org.json.JSONException: Value http of type java.lang.String cannot be converted to JSONObject
01-05 06:41:49.123 17310-17310/com.weex.app W/System.err:     at org.json.JSON.typeMismatch(JSON.java:111)
01-05 06:41:49.123 17310-17310/com.weex.app W/System.err:     at org.json.JSONObject.<init>(JSONObject.java:160)
01-05 06:41:49.123 17310-17310/com.weex.app W/System.err:     at org.json.JSONObject.<init>(JSONObject.java:173)
01-05 06:41:49.123 17310-17310/com.weex.app W/System.err:     at com.weex.app.WXPageActivity.onCreate(WXPageActivity.java:67)
01-05 06:41:49.123 17310-17310/com.weex.app W/System.err:     at android.app.Activity.performCreate(Activity.java:6040)
01-05 06:41:49.123 17310-17310/com.weex.app W/System.err:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
01-05 06:41:49.123 17310-17310/com.weex.app W/System.err:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
01-05 06:41:49.123 17310-17310/com.weex.app W/System.err:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
01-05 06:41:49.123 17310-17310/com.weex.app W/System.err:     at android.app.ActivityThread.access$800(ActivityThread.java:151)
01-05 06:41:49.123 17310-17310/com.weex.app W/System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
01-05 06:41:49.123 17310-17310/com.weex.app W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:102)
01-05 06:41:49.123 17310-17310/com.weex.app W/System.err:     at android.os.Looper.loop(Looper.java:135)
01-05 06:41:49.123 17310-17310/com.weex.app W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:5254)
01-05 06:41:49.123 17310-17310/com.weex.app W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
01-05 06:41:49.123 17310-17310/com.weex.app W/System.err:     at java.lang.reflect.Method.invoke(Method.java:372)
01-05 06:41:49.123 17310-17310/com.weex.app W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902)
01-05 06:41:49.123 17310-17310/com.weex.app W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:697)

WXPageActivity里:JSONObject initData = new JSONObject(uri.toString());
其中uri.toString()的值是file://assets/views/login.js,请问各位大侠,是什么问题?

现象:
1.入口文件默认是index.vue
1.页面跳动后,崩溃又回到index.vue,login.vue无法进入
2.如果入口文件是login.vue,页面显示无异常,但是无法利用navigator组件跳转

阅读 2.7k
2 个回答

01-05 06:41:49.122 17310-17310/com.weex.app W/System.err: org.json.JSONException: Value http of type java.lang.String cannot be converted to JSONObject

安卓可以file协议去跳转吗,先http验证下功能吧。

新手上路,请多包涵

大哥大你解决了嘛?我也这样,被搞心态炸了。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题