katzer / cordova-plugin-local-notifications

Cordova Local-Notification Plugin
Apache License 2.0
2.57k stars 1.75k forks source link

Crosswalk compability #426

Closed MaZZly closed 9 years ago

MaZZly commented 9 years ago

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?

ghost commented 9 years ago

I can confirm this issue too. Any idea? Btw., MaZZly's workaround works for me also.

shprink commented 9 years ago

same here!

katzer commented 9 years ago

https://github.com/katzer/cordova-plugin-local-notifications#i-would-like-to-propose-new-features

marco-broccio commented 9 years ago

Same here.

Temporarily use this. It works for me.

http://plugins.cordova.io/#/package/jp.wizcorp.phonegap.plugin.localnotificationplugin

DanailMinchev commented 9 years ago

I'm receiving same error in Apache Cordova Android 4.0.0

/home/danail/git/app/platforms/android/src/de/appplant/cordova/plugin/localnotification/LocalNotification.java:495: error: cannot find symbol
                    webView.evaluateJavascript(js, null);
                           ^
  symbol:   method evaluateJavascript(String,<null>)
  location: variable webView of type CordovaWebView
/home/danail/git/app/platforms/android/src/de/appplant/cordova/plugin/localnotification/LocalNotification.java:492: 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.
Note: /home/danail/git/app/platforms/android/src/org/apache/cordova/file/ContentFilesystem.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
 FAILED

According to http://cordova.apache.org/announcements/2015/04/15/cordova-android-4.0.0.html, new Android uses first-class support for Crosswalk

danielfpedro commented 9 years ago

same here

danielfpedro commented 9 years ago

Not sure if the issue is about crosswalk or the new cordova release that is building with Gradle instead Ant

katzer commented 9 years ago

local-notification plugin will support Cordova 4 and Crosswalk starting with v0.9

danielfpedro commented 9 years ago

Can you say when? I'm not trying to rush you, I'm asking because I have a project that is using crosswalk and I'm wating this release

danjohnso commented 9 years ago

I'm also running into this, any timeline on 0.9?

keenkiran commented 9 years ago

I am also running into this same issue. When do you think 0.9 will be out please ?

pnmougel commented 9 years ago

Same problem here, I would like to use this plugin with Crosswalk

mirkofisic commented 9 years ago

I have the same problem with cordova 5.0.0

TedWei commented 9 years ago

I have the same problem with cordova 5.0.0

shuhanxu commented 9 years ago

+1

sonnylazuardi commented 9 years ago

+1

seth100 commented 9 years ago

+1, same problema with cordova 5.0.0 and android platform version 4.0.0

hafeyang commented 9 years ago

+1

mejainankit commented 9 years ago

+1, i also have same issue with cordova 5.0.0 and cordova android platform 4.0.0

Durss commented 9 years ago

is it really necessary to say i have the same problem..? :p

EDIT : This branch worked for me :) https://github.com/DarianLewin/cordova-plugin-local-notifications/tree/issue-535-quick-fix

mansa-dev commented 9 years ago

+1 Crosswalk on Cordova@5.0

dwhogg commented 9 years ago

+1

martinbrylski commented 9 years ago

+1

Gaafar commented 9 years ago

+1

Gaafar commented 9 years ago

Having the same issue without crosswalk

ag-secret commented 9 years ago

Why this issue was closed?

ankitbtanna commented 9 years ago

I am having similar issue with phonegap 4.

ankitbtanna commented 9 years ago

screen shot 2015-05-25 at 9 27 29 am

This is the issue I get when I try to compile it.

sharifbdp commented 9 years ago

same problem here :(

/cordova/platforms/android/src/de/appplant/cordova/plugin/localnotification/LocalNotification.java:495: error: cannot find symbol webView.evaluateJavascript(js, null); ^ symbol: method evaluateJavascript(String,) location: variable webView of type CordovaWebView /Users/sharif/Desktop/android-project/cordova/platforms/android/src/de/appplant/cordova/plugin/localnotification/LocalNotification.java:492: error: cannot find symbol webView.post(new Runnable(){ ^ symbol: method post()

RossHartmann commented 9 years ago

+1

stramargio commented 9 years ago

same here. +1

MustafaSaleh commented 9 years ago

same

ankitbtanna commented 9 years ago

use webView.getView().eva... this should solve your problem.

Santino-Wu commented 9 years ago

+1

sharifbdp commented 9 years ago

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 :)

MaZZly commented 9 years ago

Well the fix makes the project compile.. But when calling the localnotifications functionality the app crashes so it's not really a solution...

holographix commented 9 years ago

+1 same here, no matter what the fix

bradmartin commented 9 years ago

+1 crosswalk compat. would be nice

wilianto commented 9 years ago

+1 same here

abremner commented 9 years ago

+1 Yes please.

canda commented 9 years ago

+1

dfq commented 9 years ago

+1

sebasi commented 9 years ago

I forked one a working versions with crosswalk and removed the events that were crashing the app (basically everything trying to callback to Cordova). Unfortunately I am not into Cordova that much yet so I can implement it correctly.

You will not be able to hook into events, like cordova.plugins.notification.local.on("click", callback .. ). It works for what I need. Perhaps it's enough functionality for some of you until it's fully implemented upstream.

https://github.com/sebasi/cordova-plugin-local-notifications

Cheers, Seb

marcoturi commented 9 years ago

+1

Jeff-Tian commented 9 years ago

+1

victoriaSh commented 9 years ago

+1 :( I don't use cordova-plugin-local-notifications but I began to use crosswalk I found it after updating cordova to 5.0.0 and android sdk to 22

mjot91 commented 9 years ago

+1 - I'm using Cordova 5.0.0.

winterwurzel commented 9 years ago

+1

murilolobato commented 9 years ago

+1

canda commented 9 years ago

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