在运行cordova构建之后,我使用eclipse来运行我的应用程序,并且在初始化时无法获得" cordova facebook连接插件。"和我的日志:
W/System.err( 1234): java.lang.NullPointerException
W/System.err( 1234): at
org.apache.cordova.facebook.ConnectPlugin.execute(ConnectPlugin.java:203)
W/System.err( 1234): at
org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:65)
W/System.err( 1234): at
org.apache.cordova.PluginManager.execHelper(PluginManager.java:242)
W/System.err( 1234): at
org.apache.cordova.PluginManager.exec(PluginManager.java:227)
W/System.err( 1234): at
org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:53)
W/System.err( 1234): at
com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
W/System.err( 1234): at
com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
W/System.err( 1234): at android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err( 1234): at android.os.Looper.loop(Looper.java:136)
W/System.err( 1234): at android.os.HandlerThread.run(HandlerThread.java:61)
index.js:
var app = {
// Application Constructor
initialize: function() {
this.bindEvents();
},
// Bind Event Listeners
//
// Bind any events that are required on startup. Common events are:
// 'load', 'deviceready', 'offline', and 'online'.
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
},
// deviceready Event Handler
//
// The scope of 'this' is the event. In order to call the 'receivedEvent'
// function, we must explicity call 'app.receivedEvent(...);'
onDeviceReady: function() {
app.receivedEvent('deviceready');
FB.init({
appId: "439058150542",
nativeInterface: CDV.FB,
useCachedDialogs: false
});
angular.element(document).ready(function() {
angular.bootstrap(document, ['Myapp']);
});
},
// Update DOM on a Received Event
receivedEvent: function(id) {
}
};