NativeScript / NativeScript/nativescript-cli
NS 7 thread worker native object reference null
還沒有人認領這個 Issue。
- 主要語言
- JavaScript
- 星號
- 1.1k
- 分支
- 204
- 平均合併
- 1 天 9 小時
- 30 天內合併 PR
- 8
描述
Environment
- CLI: 7.0.8
- Android Runtime: 7.0.0
Describe the bug
I'm using a custom Java class to hold native objects references to share between UI thread and an worker thread, that
Worker thread with globals module imported can find and execute native code like java.lang.Thread.currentThread().getName() or my Java Class, as expected, but when its terminated and re-created throw an error and the app stops because cannot find the native objects instances to work with.
-- First time exec
JS: =================== W0: ./aeb532eaa4f320c850fc.worker.js ===================
JS: pkg: com.jnovas {
JS: "objectpool": {}
JS: }
JS: pkg: java.lang.Thread function () { [native code] }
-- Second time exec
JS: =================== worker ===================
JS: pkg: com.jnovas {"ObjectPool":0,"objectpool":{"BuildConfig":0}}
JS: pkg: java.lang.Thread 0
JS: Uncaught TypeError: com.jnovas.ObjectPool.getInstance is not a function
Additional context
works just fine on NS 6
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
未指定來源檔案或測試。首先使用 NativeScript 7 中的自訂 Java ObjectPool 重現 worker 終止與重新建立的流程,然後與 NativeScript 6 進行比較;當重新建立的 worker 能夠解析原生物件參照並呼叫 ObjectPool.getInstance,且不出現回報的 TypeError 時,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- android, javascript
- 領域
- mobile-dev
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 需要釐清
- 新手友好度
- 25/100