集成第三方SDK的时候报的反射异常:callModuleMethod >>> invoke module:TestModule, method:connect failed. java.lang.reflect.InvocationTargetException
这是我的目录结构:
Java代码:
@UniJSMethod(uiThread = false)
public void connect(JSONObject options, UniJSCallback callback) {
Log.e(TAG, "connect" + options);
String didStr = options.getString("did");
String key = options.getString("key");
long didL = Long.parseLong(options.getString("did"));
int setUid = HmPlayer.HmNetAppSetUid(didStr);
Log.e(TAG, "uid" + setUid);
int result = HmPlayer.HmNetAppAddDevice(didL, key);
if (callback != null) {
JSONObject data = new JSONObject();
data.put("uid", setUid);
data.put("res", result);
callback.invoke(data);
}
}
运行结果: