diff --git a/Android/doric/src/main/java/pub/doric/plugin/ShaderPlugin.java b/Android/doric/src/main/java/pub/doric/plugin/ShaderPlugin.java index ec48ebd8..67163a86 100644 --- a/Android/doric/src/main/java/pub/doric/plugin/ShaderPlugin.java +++ b/Android/doric/src/main/java/pub/doric/plugin/ShaderPlugin.java @@ -145,22 +145,24 @@ public class ShaderPlugin extends DoricJavaPlugin { }; AsyncResult asyncResult = getDoricContext().getDriver() .asyncCall(callable, ThreadMode.UI); - asyncResult.setCallback(new AsyncResult.Callback() { - @Override - public void onResult(JavaValue result) { - doricPromise.resolve(result); - } + if (!method.getReturnType().equals(Void.TYPE)) { + asyncResult.setCallback(new AsyncResult.Callback() { + @Override + public void onResult(JavaValue result) { + doricPromise.resolve(result); + } - @Override - public void onError(Throwable t) { - doricPromise.resolve(new JavaValue(t.getLocalizedMessage())); - } + @Override + public void onError(Throwable t) { + doricPromise.resolve(new JavaValue(t.getLocalizedMessage())); + } - @Override - public void onFinish() { + @Override + public void onFinish() { - } - }); + } + }); + } } } } catch (ArchiveException e) {