question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crosswalk compability

See original GitHub issue

With crosswalk it doesn’t compile if localnotification plugin is used.

APP/platforms/android/src/de/appplant/cordova/plugin/localnotification/LocalNotification.java:473: error: cannot find symbol
                    webView.evaluateJavascript(js, null);
                           ^
  symbol:   method evaluateJavascript(String,<null>)
  location: variable webView of type CordovaWebView
APP/platforms/android/src/de/appplant/cordova/plugin/localnotification/LocalNotification.java:470: error: cannot find symbol
        webView.post(new Runnable(){
               ^
  symbol:   method post(<anonymous Runnable>)
  location: variable webView of type CordovaWebView
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileArmv7DebugJava'.

I can get rid of compilation errors by removing the sendJavascript function in LocalNotification.java:463 and replacing the 2 calls to it (:419 & :454) with webView.sendJavascript(js);

Then it will compile… Then when calling cancelAll() or scheduledIds() (And maybe others) the app crashes and output is: [ERROR:runtime_javascript_dialog_manager.cc(69)] Not implemented reached in virtual void xwalk::RuntimeJavaScriptDialogManager::WebContentsDestroyed(content::WebContents*)

Ideas?

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:79 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
candacommented, Jun 18, 2015

I think it is a cordova 5 issue. As stated here https://github.com/katzer/cordova-plugin-local-notifications/issues/535 I solved this way I changed LocalNotification.java both /plugins/de.appplant.cordova.plugin.local-notification/src/android/LocalNotification.java /platforms/android/src/de/appplant/cordova/plugin/localnotification/LocalNotification.java replacing the function in line 554 with

private static synchronized void sendJavascript(final String js) {

    if (!deviceready) {
        eventQueue.add(js);
        return;
    }
    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);
        }
      }
    });
    // webView.post(new Runnable(){
    //     public void run(){
    //         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
    //             webView.evaluateJavascript(js, null);
    //         } else {
    //             webView.loadUrl("javascript:" + js);
    //         }
    //     }
    // });
}
1reaction
sharifbdpcommented, May 26, 2015

I got a temporary solution. Hope it works —

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);
            }
       }
 });

HaPpY CoRdOvIaNs 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

7 Ways to Know If You're Compatible for Marriage
Before diving into the following list of considerations when searching for a spouse, take a look at Tim Keller's assessment of this idea...
Read more >
Pedestrian Compatible Planning and Design Guidelines
Guidelines on the design of a range of specific pedestrian facilities,including sidewalks, shoul- ders, medians, crosswalks, curb ramps, etc., are provided in ...
Read more >
Crosswalks - Herriman City
As a driver, each type of sidewalk should be treated differently. School Zone Crosswalks - Typically marked by zebra-style striping, when at a...
Read more >
Crosswalk and Illumination Solutions to light your way
The Crosswalk compatible Illumination component allows us to offer a comprehensive lighting solution for Crosswalks.
Read more >
How to export to Android with Crosswalk - Free Tutorial
Export your project from Construct 2 choosing the Cordova export option (since Crosswalk is a Cordova-compatible platform). In the Intel XDK, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found