FACEBOOK SDK and GOOGLE GAME SERVICES DON'T WORK TOGETHER

Hello,

Before i add Facebook SDK to my project, i added Google Play Store Game services to my project and as you all know, before you upload the .apk file to playstore, you have to create a keystore file from player setting menu. (Google Play Services work perfectly) I did all and after then i add facebook game services such as leaderboard and share etc. FB Game service uses a debug.keystore file(which is created by eclipse and facebook game services call this from .android file) and uses key hash of it to run the facebook services. But i already have a keystore file(which i created for google playstore). I need to use one keystore file to work both of them. I tried that by creating keystore file manually via eclipse and use this keystore file for both but failed. Is it possible to use both services by one keystore file? If it is, what do i need to do?

Regards
Bekir

Anyone?

This is very good question, i am having same troubles.

How did you get Facebook SDK and google play services to work together? I keep getting duplicated files which block the build. Could you please tell me which versions of facebook sdk and google play services you used? Thanks :slight_smile:

Hi. I have problem

Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
C:\Program Files (x86)\Java\jdk1.7.0_71\bin\java.exe -Xmx1024M -Dcom.android.sdkmanager.toolsdir=“C:/Program Files (x86)/Android/android-sdk\tools” -Dfile.encoding=UTF8 -jar “C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar” -

stderr[
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoIcsImpl;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoJellyBeanMr2;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoStubImpl;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompatIcs;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompatJellyBeanMr2;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/animation/AnimatorCompatHelper;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/animation/AnimatorListenerCompat;

Help
Regards
Jurij

I fixed it. The conflict is because of a duplicate in support-v4 package that comes with Facebook SDK and Google Play services.
The duplicate packages are:
Plugins-> Android ->support-v4.23.1.1.aar
FacebookSDK->Plugins ->Android->libs->android-support-v4.jar
I removed android-support-v4.jar from my project and the project compiled as normal.

2 Likes

i have deleted almost all the duplicate files but still can’t make built…plz anyone can help

Try this solutions ! Works with latest plugin versions !

Resolution for Dex issues on adding Google Play Services 0.95 and Facebook sdk 7.13.0 plugins to Unity 2018.2.0f2

Step 1: First import GooglePlayServices0.95 plugin from this link GitHub - playgameservices/play-games-plugin-for-unity: Google Play Games plugin for Unity.

Step 2: Uncheck PlayServicesResolver folder when showed folder structure to import.

Step 3: Now Import Facebook SDK 7.13.0 unity package from Downloads - Unity SDK - Documentation - Meta for Developers

Step 4: Here import all folders of the facebook sdk plugin.

Step 5: Now select Assets/PlayServicesResolver/VersionHandler/Update

Step 6: Now select Assets/PlayServicesResolver/AndroidResolver/Resolve

Step 7: Now select Assets/PlayServicesResolver/AndroidResolver/Settings and then uncheck Enable Auto-Resolution

Step 8: Now go to Project Panel and go to Assets/Plugins/Android/ and delete all folders except folder with this name “com.google.games.gpgs-plugin-support-0.9.50”

Step 9: Now go to Project Panel and go to Assets/Plugins/Android/ and delete the following files

com.android.support.animated-vector-drawable-25.3.1
com.android.support.customtabs-25.3.1
com.android.support.support-annotations-25.3.1
com.android.support.support-v4-25.3.1
com.android.support.support-vector-drawable-25.3.1

Now proceed with build making. It should work. :slight_smile:

@TeamSid I tried your solution, but got “Failed to re-package” error on building.