0

I'm trying to use the LocalNotification plugin for my Phonegap app. https://github.com/phonegap/phonegap-plugins/tree/master/Android/LocalNotification

After following all steps.. I got a lot of erros in Localnotification.java .. the rest is working fine.

What's the problem? It already starts with the first sentence:

The first two errors: import com.phonegap.api.Plugin; import com.phonegap.api.PluginResult;

Third error: public class LocalNotification extends Plugin {

I'm just a beginner.. but perhaps someone can help...? Did I missed a step, or am I missing some required files?

Using Eclipse, the newest cordova/phonegap.

4

2 回答 2

0

在这里看到同样的问题:p

似乎在这里使用相同的设置,即带有最新的cordova 和phonegap 的Eclipse。刷新插件后,Eclipse 显示 30 个错误、1 个警告、0 个其他错误。AlarmReceiver.java 中有 1 个警告和 1 个错误,其余错误在 LocalNotification.java 中。按照https://github.com/phonegap/phonegap-plugins/tree/master/Android/LocalNotification的说明进行操作。

“问题”是:

Description Resource Path Location Type
The import com.phonegap.api cannot be resolved LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 12 Java Problem
The import com.phonegap.api cannot be resolved LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 13 Java Problem
ctx cannot be resolved or is not a field LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 35 Java Problem
The method execute(String, JSONArray, String) of type LocalNotification must override or implement a supertype method LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 34 Java Problem
PluginResult cannot be resolved to a type LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 34 Java Problem
Plugin cannot be resolved to a type LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 23 Java Problem
The method cancelAllNotifications() from the type LocalNotification refers to the missing type PluginResult LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 60 Java Problem
The method cancelNotification(String) from the type LocalNotification refers to the missing type PluginResult LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 57 Java Problem
The method add(boolean, String, String, String, String, Calendar) from the type LocalNotification refers to the missing type PluginResult LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 54 Java Problem
PluginResult cannot be resolved to a type LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 38 Java Problem
PluginResult cannot be resolved to a type LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 95 Java Problem
PluginResult cannot be resolved to a variable LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 93 Java Problem
PluginResult cannot be resolved to a type LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 93 Java Problem
PluginResult cannot be resolved to a type LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 83 Java Problem
PluginResult cannot be resolved to a variable LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 111 Java Problem
PluginResult cannot be resolved to a type LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 111 Java Problem
PluginResult cannot be resolved to a type LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 106 Java Problem
PluginResult cannot be resolved to a variable LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 95 Java Problem
PluginResult cannot be resolved to a type LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 132 Java Problem
PluginResult cannot be resolved to a variable LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 132 Java Problem
PluginResult cannot be resolved to a type LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 134 Java Problem
PluginResult cannot be resolved to a variable LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 134 Java Problem
PluginResult cannot be resolved to a type LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 113 Java Problem
PluginResult cannot be resolved to a variable LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 113 Java Problem
PluginResult cannot be resolved to a type LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 120 Java Problem
ctx cannot be resolved or is not a field LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 128 Java Problem
ctx cannot be resolved or is not a field LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 151 Java Problem
ctx cannot be resolved or is not a field LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 167 Java Problem
ctx cannot be resolved or is not a field LocalNotification.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 180 Java Problem
The method setLatestEventInfo(Context, CharSequence, CharSequence, PendingIntent) from the type Notification is deprecated AlarmReceiver.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 77 Java Problem
R cannot be resolved to a variable AlarmReceiver.java / application_title_mobile/src/com/phonegap/plugin/localnotification line 72 Java Problem

编辑:刚刚在 github 上发布了一个问题:https ://github.com/phonegap/phonegap-plugins/issues/1076

于 2013-03-17T21:10:12.473 回答
0

我更新了localNotification插件以支持最新的phonegap,也许你想试试https://github.com/zhuochun/local-notification

于 2013-06-17T17:52:49.787 回答