cordova facebook插件与java.lang.NoClassDefFoundError崩溃:com.facebook.android.R $ layout

时间:2014-07-25 22:06:48

标签: facebook cordova plugins noclassdeffounderror

使用以下方式安装最新版本:

cordova -d plugin add https://github.com/Wizcorp/phonegap-facebook-plugin.git --variable APP_ID="***" --variable APP_NAME="***"

android update project --subprojects --path . --target android-19 --library FacebookLib

我认为这导致插件0.6.0和fb sdk 3.16(aprox)

在运行和登录时构建正常

 java.lang.NoClassDefFoundError: com.facebook.android.R$layout
        at com.facebook.LoginActivity.onCreate(LoginActivity.java:57)
        at android.app.Activity.performCreate(Activity.java:5312)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1111)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2552)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2653)
        at android.app.ActivityThread.access$800(ActivityThread.java:156)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1355)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:157)
        at android.app.ActivityThread.main(ActivityThread.java:5872)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:515)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:674)
        at dalvik.system.NativeStart.main(Native Method)

1 个答案:

答案 0 :(得分:1)

找到此链接

https://github.com/Wizcorp/phonegap-facebook-plugin/issues/537#issue-37034624

有完全相同的问题并签出 https://github.com/Wizcorp/phonegap-facebook-plugin/blob/develop/platforms/android/README.md#setup-without-eclipse-just-cli

唯一的区别是{Liber dir ant release下的platforms/android。 所以在做ant release之后再次构建,这次它对我有效。