Skip to content

Instantly share code, notes, and snippets.

@docherty
Last active August 29, 2015 14:26
Show Gist options
  • Save docherty/72510d86f0dbb096f6dd to your computer and use it in GitHub Desktop.
Save docherty/72510d86f0dbb096f6dd to your computer and use it in GitHub Desktop.
This is a fix for the java error thrown when trying to run v0.8.1 of the cordova localNotification plugin

To fix the build error:

..../platforms/android/cordova/plugin/localnotification/LocalNotification.java:495: error: cannot find symbol webView.evaluateJavascript(js, null);

replace the block starting at line 492 in .../plugins/de.appplant.cordova.plugin.local-notification/src/android/LocalNotification.java with this

webView.getView().post(new Runnable(){
  public void run(){
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
      webView.sendJavascript(js);
    } else {
      webView.loadUrl("javascript:" + js);
    }
  }
});
@docherty
Copy link
Author

This seems to now be at line #561

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment