cocos2d-x facebook integration problem

I intergrated by http://cocos2d-x.org/wiki/Facebook_integration_instruction_for_Cocos2d-x_and_Cocos2d-x-Lua_on_android. cocos2d-x version is cpp 3.4.

I have a some problem. my app was crashed when start.

java.lang.NoClassDefFoundError: org.cocos2dx.plugin.PluginWrapper
at org.cocos2dx.cpp.AppActivity.onCreateView(AppActivity.java:44)
at org.cocos2dx.lib.Cocos2dxActivity.init(Cocos2dxActivity.java:329)
at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:230)
at android.app.Activity.performCreate(Activity.java:4465)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1052)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1932)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1993)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1159)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4507)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
at dalvik.system.NativeStart.main(Native Method)

What I made a mistake?

After following the steps which are shown in this link http://cocos2d-x.org/wiki/Facebook_integration_instruction_for_Cocos2d-x_and_Cocos2d-x-Lua_on_android do minor changes to avoid errors.These are all the following changes

1)In Android.mk file make these changes
LOCAL_STATIC_LIBRARIES += PluginProtocolStatic
$(call import-add-path,$(LOCAL_PATH)/…/…/cocos2d/plugin/publish)
$(call import-module,plugin/protocols/proj.android/jni)
2)Add plugin protocol as library into your android project.
cocos2d/plugin/protocols/proj.android
3. Add android-support-v4.jar under android library and include to your project.

i hope it helps for you.

Thank you for your answer.
I was revert my project svn for restart interation with your answer.
But retry don’t generate fb_libproject_complete.jar file.
I don’t know Why don’t generate this file. ;-(
So, I was retry in cleaned cocos2d-x 3.6 version.

I’ve been completed, based on the information collected.

android

  1. http://cocos2d-x.org/wiki/Facebook_integration_instruction_for_Cocos2d-x_and_Cocos2d-x-Lua_on_android
    Step2: Add the following codes in proj.android/AndroidManifest.xml
    activity and provider are to inside Application tag.

  2. $(call import-module,cocos2d/plugin/protocols/proj.android/jni)
    => $(call import-module,plugin/protocols/proj.android/jni)

  3. ./publish.sh need suitable sdk api version in project.properties(protocol, facebook plugin)

Similar issues :


iOS

  1. _GCControllerDidConnectNotification link error
    Solution: Just add following frameworks BuildSettings -> Build Phase -> Link Binary with libraries MediaPlayer.framework
    GameController.framework
    http://stackoverflow.com/questions/24844766/linking-errors-when-adding-admob-to-ios-cocos2d-x-3-2

  2. #include “FacebookAgent.h” not found. need to include Header Search path. $(SRCROOT)/…/cocos2d/plugin/protocols/include