Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Fun with Android - Building things for Facebook and Exporting in general

Author
Message
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Sep 2013 01:03
As I painfully learned recently, it can be tricky to test Facebook functionality. It first requires creating a Facebook app (lots of graphics and such) and giving it enough information for Android and iOS publication.

It is possible to provide enough info to test in Android without actually registering the app with Google. The same cannot be said for iOS. It is necessary to have an iPhone/iPad App Store ID before you can create the entry with Facebook. (I will be trying to start that process for my WIP soon).

Then, unless you've registered your Player with Facebook, testing via a Player just won't work.

And, this was what was painful this week, you can't do it running the app directly from Eclipse. The app will run, but the hash key won't be correct. The hash key is one of the (annoying) things that needs to be created in order to register with Facebook (and probably publish with Google).

So, I needed to export the apk from Eclipse in order for it to have the right signature (and hash key). The Tier 2 guide is missing the steps for that, but the Tier 1 guide had a good start.

Except that the more recent versions of Android SDK and Eclipse have added a wrinkle. If you had built your project in Eclipse and then tried to export it, you would get a "Conversion to dalvick format failed with error 1" message after you entered everything and let it spin its wheels a bit building the apk.

In order to avoid that annoyance, after refreshing the project in Eclipse (to make sure it is using your most recent compilation), you need to clean it before exporting it.

This is fairly easy, from the Eclipse menu select 'Project' and then 'Clean'. Then it is up to you whether you clean everything or just the one you are exporting, as long as you clean that one.

Then continue with the export steps and your APK will be created. Copy it any which way you can to your Android device and it will now work and be able to connect with Facebook.

I thank =PRoF= for helping me figure out what I was doing wrong (and providing some very good example code for Facebook).

I suspect it is now always necessary to do the clean step before exporting from Eclipse (and this is not an issue with AppGameKit, just with with Eclipse and Android).

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Caps On!
13
Years of Service
User Offline
Joined: 3rd May 2011
Location:
Posted: 4th Sep 2013 19:57
Thanks for the post Ancient Lady. This should save me a lot of trial and error time!

Truth, Justice, and the Programmer's Way!
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 5th Sep 2013 19:22
Quote: "The app will run, but the hash key won't be correct."


Eclipse uses the android debug keystore which has a hash of Xb6GZyGCedUnAeo/9YOGjbzlbS4= if you add this to the Facebook app settings along with your own keystore hash then it should work with both Eclipse and exported apps.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 5th Sep 2013 21:24
Quote: "if you add this to the Facebook app settings along with your own keystore hash"

Well, I added the one you posted, and tested. Naturally, it complained about a hash value that was different from mine and 'yours'. And, the one it complains about is one character shorter than the others.

Even though I used a magnifying glass to make sure I got the characters correct (and tried both zero and capital O), I could not get it accepted.

Oh well, I know how to build what I need to test. It just takes extra steps.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-05-09 14:33:30
Your offset time is: 2024-05-09 14:33:30