Wizcorp / phonegap-facebook-plugin

The official plugin for Facebook in Apache Cordova/PhoneGap
Other
1.9k stars 2.01k forks source link

Phonegap Build #1037

Open eduardomsantos opened 8 years ago

eduardomsantos commented 8 years ago

Build Date: 2015-06-05 10:19:26 +0000

Buildfile: /project/build.xml

-set-mode-check:

-set-release-mode:

-release-obfuscation-check: [echo] proguard.config is ${proguard.config}

-pre-build:

-check-env: [checkenv] Android SDK Tools Revision 24.1.2

-setup: [echo] Project Name: WOUTTeste [gettype] Project Type: Application

-build-setup: [getbuildtools] Using latest Build Tools: 20.0.0 [echo] Resolving Build Target for WOUTTeste... [gettarget] Project Target: Android 4.4.2 [gettarget] API level: 19 [echo] ---------- [echo] Creating output directories if needed... [mkdir] Created dir: /project/bin [mkdir] Created dir: /project/bin/res [mkdir] Created dir: /project/bin/rsObj [mkdir] Created dir: /project/bin/rsLibs [mkdir] Created dir: /project/gen [mkdir] Created dir: /project/bin/classes [mkdir] Created dir: /project/bin/dexedLibs [echo] ---------- [echo] Resolving Dependencies for WOUTTeste... [dependency] Library dependencies: [dependency] [dependency] ------------------ [dependency] Ordered libraries: [dependency] [dependency] ------------------ [dependency] Found 2 versions of android-support-v4.jar in the dependency list, [dependency] but not all the versions are identical (check is based on SHA-1 only at this time). [dependency] All versions of the libraries must be the same at this time. [dependency] Versions found are: [dependency] Path: /project/com.phonegap.plugins.facebookconnect/woutt-FacebookLib/libs/android-support-v4.jar [dependency] Length: 758727 [dependency] SHA-1: efec67655f6db90757faa37201efcee2a9ec3507 [dependency] Path: /project/libs/android-support-v4.jar [dependency] Length: 987314 [dependency] SHA-1: 9b6a9a9078af571732159b904ad423b03b7cc786

BUILD FAILED /home/ec2-user/android-sdk/tools/ant/build.xml:577: Jar mismatch! Fix your dependencies

Is there any solution for this problem?

jgiovanni commented 8 years ago

try using this in your config.xml

<gap:plugin name="jfaris.com.phonegap.plugins.facebookconnect" version="0.11.0-jfaris.0" source="plugins.cordova.io">
        <param name="APP_ID" value="[YOUR_APP_ID]"/>
        <param name="APP_NAME" value="[YOUR_APP_NAME]"/>
    </gap:plugin>
eduardomsantos commented 8 years ago

Dosent work, i have this conflict when i added com.onesignal.plugins.onesignal plugin

jgiovanni commented 8 years ago

How about using previous versions like 0.10.1 ?

<gap:plugin name="com.phonegap.plugins.facebookconnect" version="0.10.1" source="plugins.cordova.io">
        <param name="APP_ID" value="[YOUR_APP_ID]"/>
        <param name="APP_NAME" value="[YOUR_APP_NAME]"/>
</gap:plugin>
eduardomsantos commented 8 years ago

same problem unfortunately

jgiovanni commented 8 years ago

can you list all your plugins?

eduardomsantos commented 8 years ago

com.dileep.plugins.datepicker pgb 0.0.1
com.onesignal.plugins.onesignal plugins.cordova.io 1.6.1
com.phonegap.plugins.facebookconnect plugins.cordova.io
net.tunts.webintent pgb 0.2.1
nl.x-services.plugins.googleplus plugins.cordova.io
nl.x-services.plugins.toast pgb 2.0.2
org.apache.cordova.contacts pgb 0.2.13
org.apache.cordova.device pgb 0.2.12
org.apache.cordova.device-orientation pgb 0.3.9
org.apache.cordova.dialogs pgb 0.2.10
org.apache.cordova.network-information pgb 0.2.12

Omnem commented 8 years ago

@eduardomsantos where you able to solve this ?

I seem to be getting the exact same error when adding the oneSignal plugin. I've posted the issue on their repository as well.

eduardomsantos commented 8 years ago

@Omnem no I was not able to solve it, had to use another plugin (pushapps).

jkasten2 commented 8 years ago

Unfortunately this facebook plugin includes the android-support-v4.jar bundle instead of externally defining it as a dependency like OneSignal does. As a work around to get OneSignal you can delete <project-root>\platforms\android\libs\android-support-v4.jar and build again.

Thanks.

Omnem commented 8 years ago

Thanks for answering and for your recommendation @eduardomsantos.

Using @jkasten2's solution, I was able to build locally. Thank you.

All the best.

jkasten2 commented 8 years ago

We just added our plugin to npmjs and updated it to use gradle to handle dependencies but it did not fix this issue with this official fork.

However, there is a fork of this plugin cordova-plugin-facebook4 that builds just fine with our onesignal-cordova-plugin.

Let us know if it works for you.

Edit: cordova-plugin-facebook4 and onesignal-cordova-plugin do not work on PhoneGap Build as it still uses Ant instead of Gradle to build but they are working on moving to support Gradle. See their blog post for more details. Until PhoneGap Build updates you will need to use <gap:plugin name="com.onesignal.plugins.onesignal" /> in your config.xml and won't be able to use this facebook plugin.

Thanks.

jkasten2 commented 8 years ago

We just released a PhoneGap Build compatibility version that removes the linked dependencies. This fixes all conflict issues with other plugins that use Google Play services or Android Support library v4 or v13 like the facebook plugin.

For Adobe PhoneGap Build users using com.phonegap.plugins.facebookconnect and OneSignal, include the following your config.xml file instead of "com.onesignal.plugins.onesignal":

<gap:plugin name="onesignal-cordova-plugin-pgb-compat" source="npm" />
<gap:plugin name="com.google.playservices" source="npm" />

For all other forks of Cordova using gradle builds (CLI, PhoneGap CLI, Intel XDK, Ionic, etc) we recommend using cordova-plugin-facebook4 and onesignal-cordova-plugin.

Thanks.

Omnem commented 8 years ago

Thanks, i was able to build both locally (using the original fix) and using phonegap build:

<gap:plugin name="onesignal-cordova-plugin-pgb-compat" source="npm" />
<gap:plugin name="com.google.playservices" source="npm" />

<gap:plugin name="com.phonegap.plugins.facebookconnect" version="0.9.0"> 
        <param name="APP_ID" value="..." />
        <param name="APP_NAME" value="..." />
    </gap:plugin>    

with

<preference name='phonegap-version' value='cli-5.1.1' />

Thread on OneSignal's repo: https://github.com/one-signal/OneSignal-Cordova-SDK/issues/2

k-cgomezh commented 8 years ago

Hi @jkasten2 , you said "We just released a PhoneGap Build compatibility version that removes the linked dependencies. This fixes all conflict issues with other plugins that use Google Play services or Android Support library v4 or v13 like the facebook plugin."

Please tell us how to use these plugins together because we are getting the same issue about dependencies:

gap:plugin name="com.phonegap.plugins.facebookconnect" version="0.9.0" gap:plugin name="de.appplant.cordova.plugin.local-notification" version="0.8.1"

Thanks,

jkasten2 commented 8 years ago

We created a new branch on our repo, removed the dependencies from our plugin.xml, and created another npmjs entry for it. You can see the changes in this commit. https://github.com/one-signal/OneSignal-Cordova-SDK/commit/1ed09c38cf94cfdd1259c964e6855f02e82daaf5

This does however require the end developer to know when and when not to use the compat version as they have to know which other plugins include the Android Support library or Google Play services. This isn't the nicest to maintain and a bit confusing to the end developer using the plugin but at least it provides a work around until all Cordova forks, plugins, and apps move from ANT builds to Gradle.