Android : Crash when accessing Rho::System in a separate thread

L Louis Mauchet 2 years 11 months ago
1 2 0

If i try to use a method from Rho::System, for example Rho::System.getProperty('device_name'), my app crash and i've got the messages :
Rhodes| JNIEnv is not set for this thread!!!
Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 27823 (com.mypackage.myapp)

I have a workaround by getting my property in the main thread before entering in the new one but is it a normal behaviour? What are the rho methods we cannot called in a separate thread, there is a rule about that?

Thanks

Louis

Please register or login to post a reply

2 Replies

J Jon Tara

Rhodes does not support Ruby threads on Android.

It does on iOS and I believe Windows Phone and perhaps other platforms.

I can confirm they are supported on iOS.

It's interesting that your experience suggests they may not be entirely unsupported, perhaps so long as you don't attempt to access any Rhodes APIs.

L Louis Mauchet

Thank you Jon,

I think it depends on which method you try to access. Sometimes it works and sometimes it crashes. For example i can use Rho::AsyncHttp.get without any problem but if i try to call Rho::Intent.send it crashes. That's why i was asking if there is a rule that determines what can i use or not. Alternatively, can i force some code to be executed on the main thread?

CONTACT
Can’t find what you’re looking for?