1***@qq.com
1***@qq.com
  • 发布:2024-04-07 17:55
  • 更新:2024-04-07 17:55
  • 阅读:195

原生插件调用报反射异常

分类:uni-app

集成第三方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);  
        }  
    }

运行结果:

2024-04-07 17:55 负责人:无 分享
已邀请:

要回复问题请先登录注册