You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2019/07/02 01:11:18 UTC

[GitHub] [incubator-weex] wuxinbo commented on issue #2633: android 反射方法调用失败

wuxinbo commented on issue #2633: android 反射方法调用失败 
URL: https://github.com/apache/incubator-weex/issues/2633#issuecomment-507479280
 
 
   ``` java
   if (invoker.isRunOnUIThread()) {
         WXSDKManager.getInstance().postOnUiThread(new Runnable() {
           @Override
           public void run() {
             if (invoker != null) {
               try {
                 WXSDKInstance targetInstance = WXSDKManager.getInstance().getSDKInstance(mInstanceId);
                 if (null == targetInstance || targetInstance.isDestroy()){
                   return;
                 }
                 invoker.invoke(target, params);
               } catch (Exception e) {
                 WXLogUtils.e("NativeInvokeHelper",target + " Invoker " + invoker.toString()+" exception:"+e);
               }
             }
           }
         }, 0);
       } else {
         return invoker.invoke(target, params);
       }
       return null
   ```
   建议官方打印完整的异常信息,不然会让开发者根据片面的异常判断失误。
   ``` java
   WXLogUtils.e("NativeInvokeHelper",target + " Invoker " + invoker.toString()+" exception:"+e);
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services