我创建了一个 android 应用程序(phonegap 2.0)并安装了插件:https ://github.com/mgcrea/cordova-facebook-connect
这一行:在 res/xml/config.xml 中。facebook-android-sdk.jar 在 libs/ 下并添加到构建路径中。
我的资产/www/ 包含:https ://github.com/mgcrea/cordova-facebook-connect/tree/master/samples/ios/www
当我编译它并在我的三星 2.3 Infuse 4G 上运行它时,我得到:
I/InputReader( 139): dispatchTouch::touch event's action is 1
I/InputDispatcher( 139): Delivering touch to current input target: action: 1, channel '40812958 com.example.milea/com.example.milea.MainActivity (server)'
V/webview (20224): singleCursorHandlerTouchEvent -getEditableSupport FASLE
W/System.err(20224): java.lang.ClassNotFoundException: org.apache.cordova.plugins.FacebookConnect
W/System.err(20224): at java.lang.Class.classForName(Native Method)
W/System.err(20224): at java.lang.Class.forName(Class.java:234)
W/System.err(20224): at java.lang.Class.forName(Class.java:181)
W/System.err(20224): at org.apache.cordova.api.PluginEntry.getClassByName(PluginEntry.java:103)
W/System.err(20224): at org.apache.cordova.api.PluginEntry.createPlugin(PluginEntry.java:78)
W/System.err(20224): at org.apache.cordova.api.PluginManager.getPlugin(PluginManager.java:255)
W/System.err(20224): at org.apache.cordova.api.PluginManager.exec(PluginManager.java:182)
W/System.err(20224): at org.apache.cordova.CordovaChromeClient.onJsPrompt(CordovaChromeClient.java:207)
W/System.err(20224): at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:602)
W/System.err(20224): at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err(20224): at android.os.Looper.loop(Looper.java:130)
W/System.err(20224): at android.app.ActivityThread.main(ActivityThread.java:3687)
W/System.err(20224): at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err(20224): at java.lang.reflect.Method.invoke(Method.java:507)
W/System.err(20224): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
W/System.err(20224): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
W/System.err(20224): at dalvik.system.NativeStart.main(Native Method)
W/System.err(20224): Caused by: java.lang.NoClassDefFoundError: org.apache.cordova.plugins.FacebookConnect
W/System.err(20224): ... 17 more
W/System.err(20224): Caused by: java.lang.ClassNotFoundException: org.apache.cordova.plugins.FacebookConnect in loader dalvik.system.PathClassLoader[/data/app/com.example.milea-2.apk]
W/System.err(20224): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
W/System.err(20224): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
W/System.err(20224): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
W/System.err(20224): ... 17 more
I/System.out(20224): Error adding plugin org.apache.cordova.plugins.FacebookConnect.
D/CordovaLog(20224): Error: Status=2 Message=Class not found
D/CordovaLog(20224): file:///android_asset/www/js/cordova-2.0.0.js: Line 938 : Error: Status=2 Message=Class not found
I/Web Console(20224): Error: Status=2 Message=Class not found at file:///android_asset/www/js/cordova-2.0.0.js:938
D/CordovaLog(20224): facebookConnect.login:"Class not found"
D/CordovaLog(20224): file:///android_asset/www/js/plugin.js: Line 5 : facebookConnect.login:"Class not found"
I/Web Console(20224): facebookConnect.login:"Class not found" at file:///android_asset/www/js/plugin.js:5
D/Cordova (20224): onPageFinished(file:///android_asset/www/index.html#)
D/CordovaWebView(20224): >>> loadUrlNow()
D/DroidGap(20224): onMessage(onNativeReady,null)