1

I am passing enum to the android native module, but I get this error at run time:

[ERROR] : JNIUtil: !!! Unable to convert unknown Java object class 'miy.Enums$Status' to Js value !!!

[INFO] : libc: Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 6614 (KrollRuntimeThr)

The above error is displayed before the function in the native module is even called, so it seems like the issue is in JNI layer.

So how do I pass enum to a native module?

seaotternerd
  • 6,298
  • 2
  • 47
  • 58
skcrpk
  • 558
  • 5
  • 18

1 Answers1

0

Use @Kroll.constant instead (https://github.com/appcelerator-modules/ti.map/blob/master/android/src/ti/map/MapModule.java).

farwayer
  • 3,872
  • 3
  • 21
  • 23
  • so can i not pass the enum directly to native module ? because i am getting the above error even before the function in native module is called so how can i use @Kroll.constant – skcrpk May 01 '15 at 10:17
  • You can pass to and get from native module only [such types](http://docs.appcelerator.com/titanium/3.0/#!/guide/Android_Module_Architecture-section-43289000_AndroidModuleArchitecture-TypeConversions). Is it you module? – farwayer May 03 '15 at 06:36