nativescript-cli
nativescript-cli copied to clipboard
NS 7 thread worker native object reference null
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
- Which version of NS6 runtime did it last work on?
- Can you provide a sample app (we can sign a NDA if need be) to show the issue?
- Which version of NS6 runtime did it last work on? NS v6.1.2
- Can you provide a sample app (we can sign a NDA if need be) to show the issue? demo708.zip