Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

FACEBOOK SDK and GOOGLE GAME SERVICES DON'T WORK TOGETHER

Discussion in 'Android' started by bekiryanik, Sep 2, 2014.

  1. bekiryanik

    bekiryanik

    Joined:
    Jul 6, 2014
    Posts:
    191
    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
     
  2. bekiryanik

    bekiryanik

    Joined:
    Jul 6, 2014
    Posts:
    191
    Anyone?
     
  3. adam_mehman

    adam_mehman

    Joined:
    Dec 11, 2014
    Posts:
    104
    This is very good question, i am having same troubles.
     
  4. Zewde

    Zewde

    Joined:
    Nov 30, 2015
    Posts:
    3
    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 :)
     
  5. jurijKolomijets

    jurijKolomijets

    Joined:
    Apr 28, 2014
    Posts:
    1
    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
     
  6. Shibli

    Shibli

    Joined:
    Feb 9, 2015
    Posts:
    6
    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.
     
    dhanrajsinh24 and Deleted User like this.
  7. mragini

    mragini

    Joined:
    Mar 18, 2017
    Posts:
    1
    i have deleted almost all the duplicate files but still can't make built..plz anyone can help
     
  8. TeamSid

    TeamSid

    Joined:
    Feb 27, 2015
    Posts:
    5
    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 https://github.com/playgameservices/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 https://developers.facebook.com/docs/unity/downloads/

    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. :)
     
  9. syad

    syad

    Joined:
    Feb 4, 2016
    Posts:
    2
    @TeamSid I tried your solution, but got "Failed to re-package" error on building.