[SOLVED]SDKBOX FacebookPlugin cannot login

I am using cocos2D-X v3.9, latest version of SDKBOX and FacebookPlugin.

I have no problem integrating the plugin using the installer. There was no errors given,
I have checked the documentation part on the Manual Integration of the plugin and everything seems to be in place.

I have also checked with the sample file that was on GitHub built with v3.7. Everything is identical other than the part where the latest version had the #ifdef SDKBOX_ENABLED part. I called the login function with a button attached with a touch listener event, exactly the same as the sample file given. I already set up my Facebook Dev account with a placeholder app, set up is all done on that side.

However on the app side, the login prompt just cannot seem to pop up. I tried in both debug and release mode and both doesn’t work. BUT the cool thing is that facebook actually recorded my login status and is recorded in the dashboard. I am going to attach an image later. The build log is almost identical to the one in the sample as well when I tried to built.

So right now, I am totally clueless as to why the login prompt did not pop up, or did it even login at all. I couldn’t tell.

But I have narrowed down a few ideas as to why:

  1. I did not call FacebookPlugin::setListener(this), the reason why I cannot call this is because I cannot inherit FacebookPlugin::Listener in my main scene, due to #ifdef SDKBOX_ENABLED being there. The inheritance part cannot have “#” in it.

  2. One other reason could be in the manual integration part of the documentation, be it in AndroidManifest.xml, Android.mk, Cocos2dxActivity.java, I dont know, but as I checked with the sample given, I found no issues in mine as both were pretty much identical.

  3. Setup in Developer Facebook wasn’t completed properly, I added in both my debug and release hash keys already so I dont think that’s a problem. I don’t know where else could have caused a hiccup.

  4. Final reason would be SDKBOX and cocos2d-X v3.9 has a major bug and it would cause it not to work. But then again I trust in you guys the devs, and I doubt that a newer update would not have fixed something from a lower version.

So I hope someone would enlighten me as to why my problem exists, even though I have pretty much tried every solution under my belt to try and fix it but it just doesn’t seem to be working. Meanwhile I would be posting my build log as an attachment.

Thanks for reading!

TLDR: cocos2d-x v3.9 is awesome, SDKBOX is awesome but FacebookPlugin doesnt have the login prompt. Checked with all kinds of sample projects and integration tutorial, found no diffrerences in files. The sample works great, I am able to login, but my own version does not. Anyone can help me?

cocos version: v3.9
SDKBOX and FacebookPlugin:: latest from SDKBOX.
Android OS Tested: Marshmallow and Jellybean.

BUILD LOG
Pastebin

That’s really strange, dose the SDKBOX Facebook sample works on your device?
Can you also provide the logs from logcat as well?

Yes the Facebook samples work perfectly fine. Here’s one of the logcat. I think it should be this error as I spammed the Facebook login button.

Here is an even more detailed one.

Did you call sdkbox::PluginFacebook::init() before invoking login() ?
On android it take a bit time for Facebook to initialize.

Yes I called it in AppDelegate right at the start of “applicationDidFinishLaunching” function.

Then I called the login attached to a button in my first scene.

Actually I just checked and I realised that I had 2 AppDelegate files, one is in “Classes” folder while the other one is in “proj.win32” folder. I thought I was using the wrong AppDelegate all along the entire time (as in I was using the one that did NOT have FacebookPlugin::init for my apk, which is the one in Classes folder), so I replaced it and built again, but the same error came up in logcat saying that Facebook Proxy haven’t been initialized.

Is it because of this as well? I ran another logcat and found this.

01-07 09:44:54.809 1987 3503 W ActivityManager: Unable to start service Intent { act=com.enhance.gameservice.IGameTuningService pkg=com.enhance.gameservice } U=0: not found

This is loaded right after this line (this came first):
01-07 09:44:54.788 5716 5716 D SDKBOX : JNIBridge

Holy, its because I had 2 lines of this “import android.content.Intent;” in my java file. one was ran way earilier than any other imports, I removed it and now everything is working now. So sorry for taking up your time. Thanks for the help!

Welcome, feel free to post any questions on the forum :slight_smile: