Exception in HostObject::get for prop ‘ExtSdkApiRN’: com.facebook.react.internal.turbomodule.core.TurboModuleInteropUtils$ParsingException: Unable to parse @ReactMethod annotation from native module method: ExtSdkApiRN.listeners(). Details: Unable to parse JNI signature. Detected unsupported return class: java.lang.Object[] [Component Stack] when usng react-native-agora-chat–1.3.0-alpha-0 && react-natve –0.76.1
Please help me how to solve
it shows error in the line
const chatClient = ChatClient.getInstance();
TypeError: Cannot read property ‘ChatClient’ of undefined
2
Answers
The error is in the external SDK used in the module. I can’t raise a PR because the repo isn’t on Github or I’m not sure where they publish the source.
Error Detail:
Unable to parse JNI signature. Detected unsupported return class: java.lang.Object[]
So the return type
java.lang.Object[]
is unsupported.Solution:
Return a supported type which is
WritableArray
Quick Fix:
Go to
node_modulesreact-native-agora-chatnative_srcjavacomeasemobext_sdkrnExtSdkApiRN.java
Import
WritableArray
listeners()
fromObject[]
toWritableArray
There’s a support issue for many libraries in the new RN architecture at the moment (RN 0.76 >). You might have to check for patches or downgrade.