Can't install facebook connect plugin on Android platform

I try to build an android application with de facebook connect plugin :
Wizcorp/phonegap-facebook-plugin

I do exactly what the doc means : ngCordova

At this point :

android update project --subprojects --path "platforms/android" --target android-19 --library "CordovaLib"

I have this fail :

Updated project.properties
Updated local.properties
----------
build.xml: Failed to find version-tag string. File must be updated.
In order to not erase potential customizations, the file will not be automatically regenerated.
If no changes have been made to the file, delete it manually and run the command again.
If you have made customizations to the build process, the file must be manually updated.
It is recommended to:
	* Copy current file to a safe location.
	* Delete original file.
	* Run command again to generate a new file.
	* Port customizations to the new file, by looking at the new rules file
	  located at <SDK>/tools/ant/build.xml
	* Update file to contain
	      version-tag: custom
	  to prevent file from being rewritten automatically by the SDK tools.
----------
Added file platforms/android/CordovaLib/proguard-project.txt

I used this plugin some times without problem but now i don’t know why I’m stuck,

  • I have a correct path with the sdk ( I can build my app without the plugin )

  • I tried :

    If no changes have been made to the file, delete it manually and run the command again.
    …without success !!

Please help !!! :smile:

For me the same problem, I scan all the web for finding a valid solution, but no one works completly.

I follow mainly this guide

http://ngcordova.com/docs/plugins/facebook/

Any help will be appreciated

@mhartington

i opened a issue also on the project

1 Like

some help pleaseee :smile:

Hi @rdb did you find any solutions?

yes but its not a good solution, I just did that :

cordova platform add android
cordova -d plugin add https://github.com/phonegap/phonegap-facebook-plugin.git --variable APP_ID="123456789" --variable APP_NAME="myApplication"
ionic build android

Most of the steps described in the doc did not work for me, here is what i have done to solve this issue

Configure the project with your FB app id in the res/values/facebookconnect.xml file. For example:

 <resources>
     <string name="fb_app_id">123456789</string>
     <string name="fb_app_name">TEST</string>
 </resources>

Then, type in your terminal the following commands:

(I did not run that, the platform was already installed)

 cordova platform add android

 cordova -d plugin add https://github.com/phonegap/phonegap-facebook-plugin.git --variable APP_ID="123456789" --variable APP_NAME="myApplication"

(I had to remove the build.xml present in platform/android and in platform\android\com.phonegap.plugins.facebookconnect[projectName]-FacebookLib)

 android update project --subprojects --path "platforms/android" --target android-19 --library "CordovaLib"

(The path was not correct, the correct path was com.phonegap.plugins.facebookconnect[projectName]-FacebookLib)

 android update project --subprojects --path "platforms/android" --target android-19 --library "com.phonegap.plugins.facebookconnect/FacebookLib"

 cd platforms/android/

(I got an error and found the answer online: you have to run this command BEFORE ant clean: android update project -p .)

 ant clean

(once again the repository name is not correct)

 cd com.phonegap.plugins.facebookconnect/FacebookLib

 ant clean

 open -e AndroidManifest.xml

// change your minSdkVersion and your targetSdkVersion to your environment settings for me it was:
//

(I had to create the folder ant-build manually in platform\android)

 ant release

 cd ../../../..

cordova build android

Add string resources into (I am using linux ubuntu this is my ionic project path) file : /home/user/js/fb4/platforms/android/app/src/main/res/values/strings.xml

<string name="fb_app_id">59523234234</string>
<string name="fb_app_name">hajmo.ba</string>

and my project now works!

1 Like