davejohnson/phonegap-plugin-facebook-connect — Issue #92: Problems with the patch command - Android
Author: HagayL
Created: 2012-02-04 21:26:40+00:00
State: open

Hi everybody,

I'm trying to use this plugin, followed the instructions several times and did many tries, but I couldn't get it working...
I'm working on Windows and developing an Android application using PhoneGap.

Here's where I stand in the 5-steps"Android" section of the instructions:
I did the first 2 steps (creating the application & adding the plugin entry to the xml). In the 3rd step, I ran the "git submodule update --init" command successfully. Then I ran the php command that generated the facebook_js_sdk.js file.
The problems start with the patch command patch < facebook-js-patch. This is what I get:
Hunk #1 FAILED at 1.
Hunk #2 succeeded at 10538 (offset 7966 lines).
Hunk #4 FAILED at 7918.
2 out of 4 hunks FAILED
I'm not really familiar with this step - what should be the result of a successful patch command here? What am I doing wrong?

I probably should stop here and wait for someone's answer, but I tried to continue and maybe it'll give some more information about the reason I failed until now.
I tried some possible solutions but it didn't work. Evetually I tried to continue from this point, and what I did is this (considering the note in the 3rd step of the manual):
I tried to run the "jar cf facebook-android-sdk.jar src" command, but it generated a jar file with .java files only (from what I understand the author had the same problem), so I copied the java files (there are 6 of them) to a com.facebook.android package in my application, and continued to steps 4&5. Had a problem with a single line in the FbDialog.java (line: Drawable crossDrawable = getContext().getResources().getDrawable(R.drawable.close)), so I commented it just for now.

Result when trying to run my app with the index.html taken from the "example\www" into my www folder (modified it in a single row: put my application ID in the FB.init call, instead of app_id):
When trying to login, I get a message saying "invalid key:Android key mismatch. Your key does not match the allowed key specified in your application settings".

I spent so many hours (actually, days!) on this one, any assistance would be really appreciated.
Thanks!