NativeScript / NativeScript/android

java.lang.NullPointerException: at org.nativescript.widgets.TabsBar.updateItemAt (TabsBar.java:195)

未关闭
#1,627 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
C++
星标
563
派生
144
平均合并
10 小时 46 分钟
30 天内合并 PR
14

描述

Environment

AndroidSdk = '29';
AndroidSdkBuildTools = '29.0.3';
NodeJs = '10.21.0';
NativeScriptCLI = '6.7.4';

  "nativescript": {
    "tns-android": {
      "version": "6.5.3"
    },
    "tns-ios": {
      "version": "6.5.1"
    }
  },

Describe the bug
Having a couple of hard crashes in "TabsBar" widget.

Error: 
   at com.tns.Runtime.callJSMethodNative (Native Method)
   at com.tns.Runtime.dispatchCallJSMethodNative (Runtime.java:1286)
   at com.tns.Runtime.callJSMethodImpl (Runtime.java:1173)
   at com.tns.Runtime.callJSMethod (Runtime.java:1160)
   at com.tns.Runtime.callJSMethod (Runtime.java:1138)
   at com.tns.Runtime.callJSMethod (Runtime.java:1134)
   at com.tns.NativeScriptActivity.onStart (NativeScriptActivity.java:29)
   at android.app.Instrumentation.callActivityOnStart (Instrumentation.java:1433)
   at android.app.Activity.performStart (Activity.java:7980)
   at android.app.ActivityThread.handleStartActivity (ActivityThread.java:3578)
   at android.app.servertransaction.TransactionExecutor.performLifecycleSequence (TransactionExecutor.java:221)
   at android.app.servertransaction.TransactionExecutor.cycleToPath (TransactionExecutor.java:201)
   at android.app.servertransaction.TransactionExecutor.cycleToPath (TransactionExecutor.java:183)
   at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:132)
   at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:95)
   at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2220)
   at android.os.Handler.dispatchMessage (Handler.java:107)
   at android.os.Looper.loop (Looper.java:237)
   at android.app.ActivityThread.main (ActivityThread.java:8016)
   at java.lang.reflect.Method.invoke (Native Method)
   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493)
   at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1076)
Caused by: java.lang.NullPointerException: 
   at org.nativescript.widgets.TabsBar.updateItemAt (TabsBar.java:195)

To Reproduce
not able yet

Expected behavior
dont crash

Sample project
not possible yet

Additional context
Android 9/10 until now
grafik

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 TabsBar.java 第 195 行的 org.nativescript.widgets.TabsBar.updateItemAt 开始,跟踪 stack trace 中显示的 Android 生命周期路径。尝试使用报告中的 NativeScript、tns-android、SDK 和 Android 9/10 版本复现崩溃。当 TabsBar 在受影响的生命周期路径中不再产生此 NullPointerException 时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
android, java
领域
mobile
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。