Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Error building for Android with latest facebook SDK

Discussion in 'Android' started by unisip, Sep 28, 2015.

  1. unisip

    unisip

    Joined:
    Sep 15, 2010
    Posts:
    277
    Hi,

    I'm trying to build the test app included in the facebook SDK (latest version 7.0.1), running on unity 5.1.1, but I get the following error:
    'unable to merge android manifests'.
    Main manifest has <uses-sdk android:targetSdkVersion='22'> but library uses targetSdkVersion='23'

    My Android SDK Manager indeed shows that I have sdk up to 22 but not 23. The facebook SDK is supposedly working with API level 15 and up. Is there any way I can change this targetSdkVersion to 22 ?
     
  2. IvanVI

    IvanVI

    Joined:
    Feb 17, 2014
    Posts:
    5
    Hi. Same error. Same case.
    Did you find a solution?
    Thx.
     
  3. unisip

    unisip

    Joined:
    Sep 15, 2010
    Posts:
    277
    Yes, in fact I ended up downloading API Level 23 from Android SDK MAnager and now all is fine. As far as I could tell, there was no easy way to change targetSDKVersion down from 23 to 22.

    If you go any further with the Facebok SDK on Android, here is what I am finding:
    - I can run the examples fine
    - logging in with facebook works and then the rest works fine
    - big issue: if I kill the app and restart it, after FB.Init() is completed, the status FB.IsLoggedIn is FALSE (which is problematic because it means the user has to login again through a facebook dialog). The correct behavior should be that it automatically picks up the last session, but I can't get that part to work at all. Can you?
     
  4. dimitroff

    dimitroff

    Joined:
    Apr 3, 2013
    Posts:
    105
    Here is a post on Facebook's Bugs forum about that last problem: https://developers.facebook.com/bugs/1627971237452198/

    My solution is to poll for IsLoggedIn status for no more than 5 seconds in a Coroutine and than call the OnInit callback.
     
  5. Cherubim79

    Cherubim79

    Joined:
    May 3, 2014
    Posts:
    55
    I'm having the same issue and downloading API 23 to try and fix after updating FB SDK from 6.x to 7.1.0 today. I had it working with 6.x finally for Android after a day of messing with this and then had to recode my callbacks after the update to IResult instead of FBResult. Looks like the Asset Store version is not up to date, just looking to get Android and WebGL working for my game with Facebook. Is 7.1.0 the fixed release or do we have to wait on another update? The git repo files look like they're all 7.1.0 currently.
     
  6. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,447
    The latest FB plugin is open source, so if you know of any issues you can attempt to fix them yourself...
     
  7. leopripos

    leopripos

    Joined:
    May 25, 2014
    Posts:
    18
    I have same problem, but I try to add <uses-sdk android:targetSdkVersion='23' />
    It look work well
     
unityunity