However I’m running into a number of problems for v 3.3rc1. The iOS version is working fine, but on Android and in Eclipse things don’t seem to be working.
First, step 3 which tells you to modify proj.android/jni/Android.mk results in an error that prevents the project from compiling at this line: $(call import-module,cocos2d/plugin/protocols/proj.android/jni)
Second, step 4 which tells you to use the line #include “PluginJniHelper.h” also results in a compile error. Eclipse isn’t able to find the correct header.
Third, step 8 which also asks you to modify proj.android/jni/Android.mk works but looks to attempt to do the exact same thing as step 3. Should we do step 8 and skip step 3?
Everything else runs fine but I can’t include FacebookAgent.h. Eclipse complains that it can’t find the header. If I use #include “plugin/publish/protocols/include/FacebookAgent.h” instead, it finds the header but can’t seem to find the implemented methods:
jni/…/…/Classes/somefile.cpp:153: error: undefined reference to ‘cocos2d::plugin::FacebookAgent::logout()’
after this change, compilation is fine, but I get this error
/Volumes/Home/android/android-sdk-macosx/tools/ant/build.xml:659: /Volumes/Home/projects/wordbuild/cocos2d/plugin/plugins/facebook/proj.android/DependProject/src does not exist.
I was able to get the plugin working eventually. I had to dig through a lot of other threads and documentation online as well as figure somethings out on my own. Unfortunately, in my frenzy to get everything working I didn’t document my steps to get the plugins working.
The final step that I had to do was to import the FB_LibProject_complete project into my Eclipse workspace as well. It should be the depend project in your path. Make sure you import that into your workspace.
thanks…
yes, that wiki has instructions with typos… for example, in step 1
the XML “string” at end is missing /
hard to imagine that the cocos team publishes a wiki with broken instructions
I got further on the build… right now I get linking errors.
I am not using Ecplise but rather building from the command line, so I missed step 7, to add the jar files
do you know how can I specify the jar libraries on a command line build?
errors are
[javac] /Volumes/Home/projects/wordbuild/proj.android/src/org/cocos2dx/cpp/AppActivity.java:63: error: cannot find symbol
[javac] FacebookWrapper.onSaveInstanceState(outState);
[javac] ^
Sorry, like you were saying I used Eclipse so I’m not sure how to do that via the config files You might have better luck asking the question on GitHub.
BUILD FAILED
/Volumes/Home/android/android-sdk-macosx/tools/ant/build.xml:601: The following error occurred while executing this line:
/Volumes/Home/android/android-sdk-macosx/tools/ant/build.xml:659: /Volumes/Home/projects/wordbuild/cocos2d/plugin/plugins/facebook/proj.android/DependProject/src does not exist.
this one is easy to fix, just create that folder…
just posting here hoping that the cocos team will fix this… somehow some script has to create that folder…
that said … I was able to build android with facebook plugin … from the command line… yay
@jorgeriog I have successfully integrate Plugin-X Facebook for my project. I use ver 3.3 Final.
this is what I do :
create new project using : cocos new “Your ProjectName” -p “Your Package Name” -l cpp -d “Your directory name”
compile your android project.
locate and run on terminal publish.sh in your project directory. for example : “sampleProject/cocos2d/plugin/tools/publish.sh”
run gameDevGuide.sh on terminal in same directory.
copy and paste your android project directory on the text field : for example “sampleProject/proj.android”.
note : for those who dont know where to locate his android project just drag your proj.android folder on terminal. copy and paste folder location on gameDevGuide Text Field.
Choose your plugin. for example Facebook. click Ok and close.
import proj.android on eclipse.
import Facebook Plugin on eclipse. for example : “sampleProject/cocos2d/plugin/plugins/facebook/proj.android/DependProject”.
import Facebook plugin project as library.
Create new string in string.xml. for example <string name="app_id">627454280762495</string>
}
15. Please dont use Cocos Console for compilation. I dont know why but it seem cocos console cant detect package org.cocos2dx.plugin. If you use cocos console you’ll find this error: “package org.cocos2dx.plugin does not exist”
Please use the old method, compile the project using “build_native.py” and run the project through eclipse.
for those who still failed, please ask me anytime.
I have no problem with the following instruction I mentioned above. Maybe you miss something.
I have tried the manual method but its too complicated, so I use gameDevGuide for simplicity.
Maybe you can use the auto method.
What I get from this log is that it doesn’t detect com.facebook.NativeAppCallContentProvider.
I dont know whats the problem.
Do you use “publish.sh” from plugin folder?
If you dont please use it, its easier than manual method. So many code must be included on multiple file.
I never success implement plugin using manual method.
Or have you added this on android.mk?
$(call import-module,plugin/protocols/proj.android/jni)
There were a lot of bugs in both the iOS and Android implementation of Plugin-X and their Facebook plugin. If I were to do it over again, I would definitely start from scratch. I think the only part of the plugin-x framework that has been beneficial is the JNI glue code and helpers written that pass data structures semi-transparently from native to Java and Obj-C.
I also ended up pretty much rewriting the entirety of the Android Google Play IAP code and reworking most of the flow of the iOS IAP code.