我正在尝试安装PushPlugin运行一个phonegap应用程序。 我用这个命令添加了插件:
$ phonegap local plugin add https://github.com/phonegap-build/PushPlugin
它经历了好的。 我将PushNotification.js文件添加到我的“www”文件夹并在index.html中引用它。 然后我添加了一些代码来处理index.js文件中的通知。 我试图运行该应用程序:
$ phonegap local run android
得到了这个:
-compile:
[javac] Compiling 8 source files to /Users/nadavelyashiv/Code/PushNotificationSample/platforms/android/bin/classes
[javac] /Users/nadavelyashiv/Code/PushNotificationSample/platforms/android/src/com/plugin/gcm/GCMIntentService.java:96: cannot find symbol
[javac] symbol : method getString(java.lang.String)
[javac] location: class com.plugin.gcm.GCMIntentService
[javac] .setTicker(getString("title"))
[javac] ^
[javac] /Users/nadavelyashiv/Code/PushNotificationSample/platforms/android/src/com/plugin/gcm/GCMIntentService.java:95: cannot find symbol
[javac] symbol : method getString(java.lang.String)
[javac] location: class com.plugin.gcm.GCMIntentService
[javac] .setContentTitle(getString("title"))
[javac] ^
[javac] 2 errors
BUILD FAILED
/usr/local/Cellar/android-sdk/r22.0.4/tools/ant/build.xml:720: The following error occurred while executing this line:
/usr/local/Cellar/android-sdk/r22.0.4/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.
这里似乎有什么问题? 谢谢。
答案 0 :(得分:1)
发现问题,在项目上创建了PullRequest:
https://github.com/phonegap-build/PushPlugin/pull/83/files
你应该更新android / com / plugin / gcm / GCMIntentService.java的第95行和第96行的代码
.setContentTitle(extras.getString("title"))
.setTicker(extras.getString("title"))