Hi Brendan,
Could you please provide further details on the issue:
Thanks
Eva
Hi Brendan,
my best guess, without knowing anything about NativeScript or your code, is that you're having a blocked main thread. Here's how I think it happens:
The dispatchCallJSMethodNative function (or any of the related functions preceding it) acquires a lock and invokes onPause of the ArchitectView, onPause spawns a thread and waits for its completion (the spawning of the thread is irrelevant, onPause being a blocking function call is the important bit). This spawned thread then ultimately runs the onCameraReleased function which you pick up on and call dispatchCallJSMethodNative again, which, if my guess is correct, blocks indefinitely because it cannot acquire the lock due to it being locked already.
Bottom line, you're not allowed to do that. It would be great if you could find out whether the locking happens in the manner I assume it does.
Here are the relevant parts of the call stack:
- main thread
at java.lang.Object.wait(Native method)
- waiting on <0x063cb3e5> (a java.lang.Object)
at java.lang.Object.wait(Object.java:422)
at java.lang.Thread.join(Thread.java:1260)
- locked <0x063cb3e5> (a java.lang.Object)
at java.lang.Thread.join(Thread.java:1336)
at com.wikitude.common.rendering.internal.b.onPause(ProGuard:127)
at com.wikitude.common.rendering.RenderSurfaceView.onPause(ProGuard:227)
at com.wikitude.architect.ArchitectView.onPause(ProGuard:876)
at com.tns.Runtime.callJSMethodNative(Native method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
at com.tns.Runtime.callJSMethod(Runtime.java:957)
at com.tns.Runtime.callJSMethod(Runtime.java:941)
at com.tns.Runtime.callJSMethod(Runtime.java:933)
- spawned from main
at java.lang.Object.wait(Native method)
- waiting on <0x0ba52399> (a com.tns.Runtime$3)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1121)
- locked <0x0ba52399> (a com.tns.Runtime$3)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
at com.tns.Runtime.callJSMethod(Runtime.java:957)
at com.tns.Runtime.callJSMethod(Runtime.java:941)
at com.tns.Runtime.callJSMethod(Runtime.java:933)
at com.tns.gen.java.lang.Object_frnal_ts_helpers_l58_c38__CameraLifecycleListener.onCameraReleased(Object_frnal_ts_helpers_l58_c38__CameraLifecycleListener.java:21)
at com.wikitude.architect.ArchitectView.onCameraReleased(ProGuard:323)
at com.wikitude.common.camera.internal.CameraService.onCameraReleased(ProGuard:87)
at com.wikitude.common.camera.internal.e.b(ProGuard:206)
at com.wikitude.common.camera.internal.CameraService.c(ProGuard:64)
at com.wikitude.common.services.internal.ServiceManagerInternal.stopService(ProGuard:76)
at com.wikitude.common.rendering.internal.NativeRenderer.onPause(Native method)
- Daniel
Brendan Ingham
I'm currently writing a nativescript-plugin for Wikitude, if you are not familiar with nativescript, it is a JS Framework that allows you to use Native Libraries with Frameworks like Angular for Mobile Applications...
If interested you can see my plugin here:
https://bitbucket.org/SD-CLIENTPROJ/nativescript-wikitude
The Issue i am having is that the Wikitude Viewer seems to hang "sometimes" if i have the Camera Lifecycle Events being listened to.
it freezes after onCameraReleased.
I can ofcourse disable this event-set for now, but as i am writing a generic plugin i would like to offer developers the full range of the SDK.