Facebook causing android build error

Facebook causing android build error
0.0 0


u can check our example. https://github.com/sdkbox/sdkbox-sample-facebook

works with target=android-26.


Thanks, as I said - everything start to work after I restarted my computer.

Now I wonder, that are the chances my app will be received by “Facebook games”.


Debug app (with facebook-test-app-id) works ok (except logon with permissions list - usually it fails).
But my app both debug and release versions with facebook-app-id (not test) prompts error “Facebook plugin haven’t been initialized.”
I did my app “public” in facebook.

Q: Should your “sdkbox-sample-facebook” app login ok to facebook, if I build it on my computer in release mode (so using my alias+keystore)?


To test our example, u need to make some change.

Key Hashes:

keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64

keytool -exportcert -alias YOUR_RELEASE_KEY_ALIAS -keystore YOUR_RELEASE_KEY_PATH | openssl sha1 -binary | openssl base64


But I will not be able to change facebook-app-id into yours - will it work? The combination of my release facebook-app-id and my Key Hash?

About my app: its free, first I created an ID for it in Facebook.
Then I added package_name and class_name and hash_keys - both debug and release – for my app both debug=Test and release facebook_app_id-s).
So debug version works ok.

For my app release-version I get «publish_actions» permission and I made it “public” in Facebook, but I get this error “Facebook plugin haven’t been initialized.”

Now about testing your example: it has its own (different than my app) package name, facebook-app-id and key-hash.
I can use your package name and facebook-app-id in your project “org.cocs2dx.facebook” my version (build on my computer); but what about key-hash?

I can’t have yours and I cant add mine key-hash into your facebook-project “org.cocs2dx.facebook” page.
…So I think I will not be able to connect and successfully perform other actions with your facebook example.
Where am I wrong?

Upd.: Aha… I did the same mistake again:
Two weeks ago I forget to add "Facebook": { "debug": false }, into Resources\sdkbox_config.json
And now I missed some curly bracket }
Alas both time I have not admit any prompt about my mistakes.

After fix it works ok; except I can’t perform permissions.push_back(sdkbox::FB_PERM_PUBLISH_POST); and then PluginFacebook::login(permissions); just simple login.


how about


Yes, it works, if I call it one by one: first asking to login (in FB dialog app prompts it will have no permissions), then asking about permission (to publish).


Important update: “it works” for a project created with Cocos 3.14.1 and built with Cocos 3.16 on Win7 (with cleaning = deleting android \bin \gen \obj folders) and building with android-26 and with <uses-sdk android:minSdkVersion="15" android:targetSdkVersion="26" /> in AndroidManifest.xml

Because when I’ve tried to create empty project (with Cocos 3.16), I get the old problems:

App crashes on my devices (with error E dalvikvm: dlopen("/data/app-lib/com.spring.addition_2_-2/libMyGame.so") failed: dlopen failed: cannot locate symbol "rand" referenced by "libMyGame.so"...), if built with android-26 (with or without facebook).

Or after adding facebook the app refuses to build with android-19 prompting error No resource found that matches the given name (at 'cardBackgroundColor' with value '?android:attr/colorBackgroundFloating')