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 / Facebook login for v10818 also not right in Android

Author
Message
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 3rd Sep 2013 00:48 Edited at: 4th Sep 2013 00:50
EDIT: This has been worked out. But I will leave the original stuff rather than editing everything.

So, again testing a very simple Android app to log in to Facebook and getting odd results.

The test app uses an app id that has been successfully (sort of) used to log in to Facebook (provided for testing by another developer).


Let's start with the Player tests. I have two for v10818. One I built myself and the other downloaded from the 'My Products' TGC page.

With the downloaded one, the app starts, a facebooky looking sort of screen pops up and disappears (like it is trying to log in), then the screen goes black with the text "Please Wait..." in the middle and it hangs there. Touching the back button takes me back to the app and it says that it could not log in.

With my home built Player (and I've never had issues doing my own ones before), as soon as it tries the FacebookLogin() command, it crashes with the message "Unfortunately, v10818 Player has stopped". I had started this Player from Eclipse, so was able to catch the LogCat output.

Here is the output just before and after the crash:


I ran similar code in Tier 2 (based on my own template):


It was also run from Eclipse (it fails just the same as if run directly) and the LogCat produced (this is all of it):


It is the same issue for both Tiers. And it happens in the same place (also the same place there is an issue in iOS).

Googling the main error code ("Could not find method android.support.v4.content.LocalBroadcastManager.getInstance") produced some things that seem to indicate the Facebook SDK may be out of sync with the android-support-v4.jar file.

It may be that the Facebook SDK and android-support-v4.jar file in my Android setup are different from those used to build the Player on the TGC site. Since I am using the facebook directory from teh installation, that might mean that the android-support-v4.jar file is the culprit.

My android-support-v4.jar file is dated 30-May-2013 and is 484,258 bytes in size.

So, in combination with the Facebook login issues with iOS I reported, make using Facebook a bit difficult right now.

I am open to help and suggestions.

I am using only Tier 2 for my own projects.

And it looks like the issue as it plays in the TGC Player and in iOS are related. They both have a problem getting back to the original app. At least that is how I interpret where it is hanging on Android with "Please Wait...".

EDIT: I found the fix for the crash on Android. Open the project properties, click on 'Java Build Path', then on the 'Order and Export' tab and make sure everything is checked (especially the 'android-support-v4.jar' entry.

So, now everything has the same problem. It gets stuck on "Please Wait..." and the login fails.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
xGEKKOx
AGK Master
15
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 3rd Sep 2013 02:58 Edited at: 3rd Sep 2013 03:00
For iOS... i suggest to use always the Facebook OBJ C.
Not because AppGameKit don't work, but because FB SDK changes are really frequent as the iOS too...
This is what i mean when i say divide from Extras!!!!

You have the issue that was the reason my SKF2 was released 1 month later.

In fact, now i have :
FB Post Screenshot
FB Chat
FB Post + Post Scores
FB Feeds
FB Comments
and other all in OBJ C.

Long life to Steve!
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 3rd Sep 2013 10:46
I recently published an app on the Google play store which successfully used the FB commands, both when broadcast to the player (the latest player from the play store) and when installed on a device from an Apk.

I used beta 18 tier 1 and the online Apk tool.

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 3rd Sep 2013 11:17
Quote: "For iOS... i suggest to use always the Facebook OBJ C."

This thread is regarding Tier 1.

"Here I am trying to do some good for the world..." - Fluffy Rabbit
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 3rd Sep 2013 16:13
Quote: "This thread is regarding Tier 1."

Actually, it is both Tiers, since the login doesn't work correctly in either.

=PRoF=, which commands are you using? Can you show the steps you used to do the login? Were you able to test well before you actually published the Android app? (Maybe my problem is because the app isn't actually registered with Google, yet.)

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 3rd Sep 2013 16:55
Weirdly my code for logging in is almost the same as yours.



The above snippet is just an example which logs in, downloads your name, friends list and displays the display picture of a random friend off your list. As well as making a post onto your FB Wall.

As well as the AppGameKit stuff above, you also need to correctly set up the FB Developer App page.



Mine look something like this, although you will need to add your own email and key hash.

You don't need to have it published on the store for it to work.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 3rd Sep 2013 17:34
Okay.

It may be that the test app didn't connect properly.

It didn't have the correct package name for the FB ID and hash. I'll need to test again with my WIP and see if it behaves/misbehaves.

Thank you for sharing your code and other information. The code is particularly helpful because it shows using several commands.

I'll post after I continue my next set of tests.

Is there somewhere in the AndroidManifest.xml that you are supposed to put the hash value?

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 3rd Sep 2013 18:02 Edited at: 3rd Sep 2013 18:07
I only entered the key hash on the FB page, but I used TGC's online .apk maker to compile the program to an apk.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 3rd Sep 2013 23:33
I double checked my Facebook app configuration against my AndroidManifest.xml file and discovered that I had changed the package name in the xml file, but not in my Facebook app configuration.

Then it complained about the hash not being correct.

(palm to forehead)Naturally the hash would not be right when run from Eclipse.

So, I used Eclipse to package the apk.

Just so others don't smack themselves silly when they get the "Conversion to dalvick format failed with error 1" message, do this step first in Eclipse, before trying to export and sign with your keystore:
Project->Clean

Having done that, I copied the apk to my Nexus 7 and installed it. Then navigated to the Options page (where my Facebook connect button is), hit the button. And it worked flawlessly!

So, there is nothing basically wrong with the Android Facebook log in process. It all comes down to proper configuration and installation. And it means going through major hoops to test with a Player.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Sep 2013 00:01
=PRoF=, doubly thank you for your code post.

I was just able to add a FacebookPostOnMyWall call that included my app image (from the site that will be supporting) it and it appeared in both my iOS and Android Facebook apps.

I had gotten that to work once before and then lost the project it was done in. Now I can do it again.

But it did ask take me to the Facebook login page the first time. So, after opening Facebook on my Nexus 7, the next time it went through.

I am a happy camper right now.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 4th Sep 2013 00:42
No worries Ancient Lady, glad to help

Login to post a reply

Server time is: 2024-05-09 17:04:49
Your offset time is: 2024-05-09 17:04:49