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. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

You don't have Android SDK Setup! Facebbok SDK

Discussion in 'Android' started by alexdevAo, Feb 25, 2020.

  1. alexdevAo

    alexdevAo

    Joined:
    Apr 26, 2013
    Posts:
    28
    Hello guys, I'm using the Facebook SDK in my project and I see this error:
    You don't have Android SDK Setup! Go to Edit -> Preferences ...

    I'm using Unity 2019.3.2 and it came with the Android SDK. I don't know why I'm having this error.
    Also, I can't get Debug android key hash.
    Any solution for that?
    Thanks in advance.
     

    Attached Files:

    • dess.png
      dess.png
      File size:
      15.7 KB
      Views:
      1,820
    YouKaTaN, lucbloom and Novack like this.
  2. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    821
    I don't know how Facebook SDK tries to get Android SDK path exactly, but I would guess it's trying to use editorprefs undocumented value. With Unity 2019.3 that value is not set anymore when the "<tool> installed with Unity" checkbox is selected.
    Maybe there is a newer Facebook SDK version which uses out API to get that path? Check for the updates. If you are using the latest version of Facebook SDK, you could try to set an ANDROID_SDK_ROOT environment variable and restart the Unity editor. This might work if Facebook SDK looks for that env var. Alternatively you could go to preferences -> external tools in Unity editor, uncheck the "SDK installed with Unity" checkbox and set SDK path to a valid location. After that it's up to you if you want to re-enable the "SDK installed with Unity" checkbox or not. I would recommend to enable it, but keep in mind that the Facebook SDK will use the path that you've manually set there, so if you set a path to an SDK installed with a specific Unity version (such as 2019.3.2), if you will install a newer Unity version in the future and remove 2019.3.2, then Facebook will not be able to find Android SDK again. Because of that, if you are going to set the SDK path manually, better set to a location that will not get removed when Unity is uninstalled.
    These suggestions are just guesses as I don't know how exactly Facebook's SDK works.
     
  3. alexdevAo

    alexdevAo

    Joined:
    Apr 26, 2013
    Posts:
    28
    I did just that and it worked. I unchecked the "SDK installed with Unity" checkbox and i set SDK path to a valid location.
    It must be a Facebook SDK bug, they need to fix this.

    Thanks!
     
  4. alexdevAo

    alexdevAo

    Joined:
    Apr 26, 2013
    Posts:
    28
    Now that error has arisen.
    Your Android debug keystore file is missing!

    I already had Debug Android Key Hash.
    What is Ecplise? Do I need to install Eclipse?
     

    Attached Files:

  5. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    821
    Debug keystore is generated by Android Studio or by Unity when building an app and no debug keystore is present. If you have a fresh system which has never built android app before, try to create a new Unity project and just build it for android. That should generate a debug keystore. After that when you will open your current project, Facebook SDK should be able to locate debug keystore.
     
    Naxionman1978 and alexdevAo like this.
  6. alexdevAo

    alexdevAo

    Joined:
    Apr 26, 2013
    Posts:
    28
    Thanks!
     
  7. eddimull

    eddimull

    Joined:
    May 12, 2020
    Posts:
    1
    If that doesn't work, make sure that some of the other system variables are reading as expected (for Windows)

    Check out the DebugKeyStorePath in the sdk:
    https://github.com/facebook/faceboo...k.Unity.Editor/android/FacebookAndroidUtil.cs

    On the domain that my computer is connected to, the %HOMEDRIVE% variable was not set to C, so no matter how many times I ran variations of the above steps, it did not work. I wasn't able to overwrite the %HOMEDRIVE% system variable since that is controlled by the domain, so I had to make a copy of the .android content onto my z: drive.

    Long story short, check to make sure that %HOMEDRIVE%\%HOMEPATH%\.android\debug.keystore exists
     
  8. k_belonogov

    k_belonogov

    Joined:
    Jan 12, 2016
    Posts:
    10
    "You don't have Android SDK Setup! Go to Edit -> Preferences ..."
    0. Go to Preferences -> External tools
    1. Click button "Copy path" near embedded path
    2. Uncheck the toggle
    3. Paste from clip board (the same path as embedded Android sdk with Unity)
    4. Check the toggle again
     
    Suve, YouKaTaN, tamizhan and 52 others like this.
  9. mubashirmirza

    mubashirmirza

    Joined:
    Jan 29, 2019
    Posts:
    1
    I was also facing the same problem by unchecking and manually putting the address there solved the problem but now it's giving another new error "OpenSSL not found. Make sure that OpenSSL is installed, and that it is in your path."
     
    lucbloom likes this.
  10. redtwoapps_rule

    redtwoapps_rule

    Joined:
    Sep 2, 2015
    Posts:
    1
    Worked like a treat!
     
  11. phong-genix

    phong-genix

    Joined:
    Oct 28, 2015
    Posts:
    139
    Works for me too. Thanks a lot!
     
  12. berkcebeci

    berkcebeci

    Joined:
    Dec 25, 2019
    Posts:
    1
    Tried it and worked in Unity 2019.4.1. Thanks!
     
  13. Kay86X

    Kay86X

    Joined:
    May 9, 2017
    Posts:
    10
    This worked for me!
     
  14. LemanColt

    LemanColt

    Joined:
    Oct 17, 2014
    Posts:
    12
    Solved my problem as well after moving project to a new dev computer.
     
  15. ubi13th

    ubi13th

    Joined:
    Dec 7, 2019
    Posts:
    2
    Best of the best!
     
  16. EmilGlz

    EmilGlz

    Joined:
    Nov 23, 2019
    Posts:
    2
    Worked, thank you
     
  17. lucbloom

    lucbloom

    Joined:
    Mar 27, 2020
    Posts:
    27
    Did you manage to fix it? I'm getting the same error now.

    (By the way, k_belonogov thank you for a great workable solution.)
     
  18. LeleUnity

    LeleUnity

    Joined:
    Jul 30, 2016
    Posts:
    97
    I was also facing the same problem by unchecking and manually putting the address there solved the problem but now it's giving another new error "OpenSSL not found. Make sure that OpenSSL is installed, and that it is in your path."
     
  19. Last_Imba

    Last_Imba

    Joined:
    Feb 25, 2017
    Posts:
    43
    This video describes how to fix OpenSSL not found and Keytool not found issues.
     
    vsapozhkov likes this.
  20. JunixOp

    JunixOp

    Joined:
    Feb 23, 2021
    Posts:
    1
    This solved my deployment problem. Thanks!
     
  21. fabiareor

    fabiareor

    Joined:
    Jul 30, 2019
    Posts:
    4
    That did not work for me, I still get the same error.
     
    dolaniyan2 likes this.
  22. dolaniyan2

    dolaniyan2

    Joined:
    Oct 7, 2016
    Posts:
    1
    I've got the same issue and I'm running 2020.3.31f
     
  23. arssarath23

    arssarath23

    Joined:
    Nov 26, 2021
    Posts:
    10

    It was work thanks
     
  24. MontanaAnton

    MontanaAnton

    Joined:
    Feb 16, 2014
    Posts:
    11
  25. RaventurnPatrick

    RaventurnPatrick

    Joined:
    Aug 9, 2011
    Posts:
    90
    @JuliusM Can you explain why this workaround fixes the problem? Seems to be a Unity Editor Bug - that the AndroidSdk Path is not properly set otherwise
     
    studentvz likes this.
  26. lorenzostudiosok

    lorenzostudiosok

    Joined:
    Feb 3, 2020
    Posts:
    20
    ok!!
     
  27. the_nem_s

    the_nem_s

    Joined:
    Jan 28, 2021
    Posts:
    2
    many many many times TNX !! !! !! !! !! !! !! !! !! !! !! !! !!
     
  28. CodeWithKyrian

    CodeWithKyrian

    Joined:
    Aug 17, 2017
    Posts:
    7
    Beautiful. Works like charm. Thanks for this!
     
  29. nasir_41

    nasir_41

    Joined:
    Dec 21, 2015
    Posts:
    7
    Well Well Well!
    Working solution..
     
  30. kcastagnini

    kcastagnini

    Joined:
    Dec 14, 2019
    Posts:
    54
    Thanks!
     
  31. tamizhan

    tamizhan

    Joined:
    Feb 23, 2018
    Posts:
    6
    This is worked for me
     
  32. ckocank

    ckocank

    Joined:
    Sep 29, 2020
    Posts:
    3
    any solution for macos, i'm using unity 2021.3.8f1
     
  33. vuquangdai23

    vuquangdai23

    Joined:
    Jan 27, 2021
    Posts:
    3
    Many thanks, I tried and it worked, I using unity 2019.4.38f1
     
  34. georsavvides

    georsavvides

    Joined:
    Jun 15, 2019
    Posts:
    2
    worked for me too, in Unity 2021.3.12.
    Thanks !
     
  35. Tortuap

    Tortuap

    Joined:
    Dec 4, 2013
    Posts:
    118
unityunity