Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Select Android SDK root Folder.

Discussion in 'Android' started by voltage, Mar 21, 2012.

  1. voltage

    voltage

    Joined:
    Nov 11, 2011
    Posts:
    515
    So my initial problem was resolved in an earlier thread, It turns out the SDK Manager required me to activate Administrator rights, regardless of my current administrator rights. Meh.

    Anyway, when I (Build Run) my application through unity, a window will pop up, prompting me to save my .apk file in my project folder, afterwards, another window will pop up, prompting me to 'Select an Android SDK root Folder'. Could anyone explain to me why this is happening? I've looked up guides to exporting your app, but no video displayed this window as mine will.
     
    MajuPropertindo likes this.
  2. tigerfoot

    tigerfoot

    Joined:
    Nov 2, 2009
    Posts:
    132
    Just select Android SDK root folder. It should be something like this: C:\Program Files (x86)\Android\android-sdk

    Or go in Unity -> Edit -> Preferences -> External tools and put in android sdk folder path there.
     
  3. TeotiGraphix

    TeotiGraphix

    Joined:
    Jan 11, 2011
    Posts:
    145
    Are you saying that every time you Build Run you are getting the sdk selection window? Event when you have selected it prior?

    Mike
     
  4. bleater

    bleater

    Joined:
    Apr 19, 2012
    Posts:
    26
    I'm getting the same problem. The Android SDK setting doesn't seem to "stick". I get prompted each part way through an Android build each time. If I manually selected the Android SDK root, it just silently fails with nothing appearing in the output folder.

    At least an error dialog might help diagnose things here...
     
    lweller2020 likes this.
  5. inkbirdstudios

    inkbirdstudios

    Joined:
    Mar 12, 2012
    Posts:
    20
    did any one figure this out, im also stuck on this problem
     
    lweller2020 likes this.
  6. bleater

    bleater

    Joined:
    Apr 19, 2012
    Posts:
    26
    Yes I did. The problem became more apparent when I tried to actually launch the Android SDK Manager, and that failed. I couldn't resurrect the Android SDK's config, so I did a complete reinstall of the Android SDK, plus an upgrade of the Java SDK. At that point I was able to run the Android SDK Manager, and select it in Unity without error.
     
    naviln and Greenfriendly like this.
  7. Tosi999

    Tosi999

    Joined:
    Mar 12, 2014
    Posts:
    1
    Im having the same problem,I tried all the ways but still stuck
     
    lweller2020 likes this.
  8. Jinyi4131

    Jinyi4131

    Joined:
    May 14, 2014
    Posts:
    1
    Same problem here. I'll try to re-install my Android SDK and maybe Java as well and come back when i figure something out
     
  9. Vibhansh

    Vibhansh

    Joined:
    Aug 24, 2014
    Posts:
    1
    Same problem here . Please Help!
     
  10. scritchy

    scritchy

    Joined:
    Dec 30, 2010
    Posts:
    94
    same problem here, particularly when running in batch mode from commandline. watching the relevant files, it looks as if the android sdk path is getting cleared in the editor prefs file by something, i don't know what. anybody else have luck?
    i'm not sure why reinstalling the android sdk would matter, since if i select it each time it works just fine.
     
  11. tiz777

    tiz777

    Joined:
    Jan 20, 2010
    Posts:
    93
    Had a similar problem: Unity didn't allowed me to select the android-sdk path.
    I solved this (on Windows) by running (as administrator) the SDK Manager located in android-sdk folder and then I simply installed all the selected packages (without system images, I just didn't needed it).
    Hope can help someone :)
     
  12. Arq-IGGS

    Arq-IGGS

    Joined:
    Nov 27, 2014
    Posts:
    1
    I could!!!!! Escribiré en Español.
    1. Mostrar archivos ocultos (según esta página http://appleweblog.com/2006/07/mostrar-archivos-ocultos-en-finder)
    2. Aparece la ruta ddl SDK cuando abrimos el SDK manager /Users/"user"/Library/Android/sdk
    3. Al mostrar los archivos ocultos podemos ver la carpeta Library/Android/sdk
    4. Arrastrar la carpeta SDK al panel de accesos rápidos del finder
    5. Al hacer el build de android, dar click a la carpeta sdk que pusimos en el panel de accesos rápidos del finder.

    Espero les funcione!!!!!
     
    nik3011 and JPueyo like this.
  13. BroGaming

    BroGaming

    Joined:
    Aug 2, 2014
    Posts:
    1
    C:\Users\User\AppData\Local\Android\sdk1
     
  14. masacre235

    masacre235

    Joined:
    Mar 8, 2015
    Posts:
    1
    [Quote = "BroGaming, post: 1938927, miembro: 665784"] C: \ Users \ Usuario \ AppData \ Local \ Android \ sdk1 [/ quote]

    C: \ Users \ Usuario \ AppData \ Local \ Android \ sdk1 (mostrando todos los archivos oculto funciona al 100%)
     
    Martinez-Vargas and dibyenshu like this.
  15. rash rider

    rash rider

    Joined:
    Mar 12, 2015
    Posts:
    2
    same problem
     
  16. rash rider

    rash rider

    Joined:
    Mar 12, 2015
    Posts:
    2
    i resolved it download the android studio and open it
    • In Android Studio, click SDK Manager in the toolbar. and done
    • now go to unity edit preferences C: \ Users \ administrator \ AppData \ Local \ Android \ sdk
     
  17. Dav36id

    Dav36id

    Joined:
    Apr 1, 2015
    Posts:
    7
    Excellent bro!
     
  18. AnsonMustang

    AnsonMustang

    Joined:
    Apr 20, 2015
    Posts:
    2
    help still needed...
    I have installed all of the things yet I still can't locate my sdk root folder
     
  19. ngothanhtai

    ngothanhtai

    Joined:
    Jan 26, 2014
    Posts:
    3
    Hi,

    I have this problem on Windows and solved it by following these steps:
    1. After installing Android SDK, open Android SDK Manager
    2. Check to install
    • Tools/Android SDK Platform-tools
    • Android Support Library
    • Google USB Driver
    After install those things, Unity can detect Android SDK folder.

    Hope this help!
     
    RediGames and Yurasick like this.
  20. writteninheaven

    writteninheaven

    Joined:
    Apr 15, 2014
    Posts:
    1
    install the platform tools in the sdk manager from android studio. my sdk location was listed at the top. I had to just type the path into the spot where you browse for the folder cuz I couldn't find the location from folder to folder.
     
  21. greatlion

    greatlion

    Joined:
    Aug 12, 2015
    Posts:
    1
    This worked for me ))
     
  22. mrdennys

    mrdennys

    Joined:
    Sep 17, 2015
    Posts:
    1
    Solved too.

    Thanks!!!

    C:\Users\User\AppData\Local\Android\sdk1
     
  23. gearworks

    gearworks

    Joined:
    Mar 24, 2013
    Posts:
    3
    Had this problem using commandline builds on osx: Unity "forgot" the placement of the sdk once the machine was rebooted.
    I solved it by placing the sdk in a "Shared" folder (instead of somewhere inside a user folder)
     
  24. SniperEvan

    SniperEvan

    Joined:
    Mar 3, 2013
    Posts:
    161
    Thanks
     
  25. rendermouse

    rendermouse

    Joined:
    Dec 9, 2015
    Posts:
    8
    This worked for me after I had installed the Android Studio:

    C:\Users\{username}\AppData\Local\Android\sdk
     
    lermy3d likes this.
  26. sIothman

    sIothman

    Joined:
    Apr 11, 2016
    Posts:
    5
    I went to edit ->Preferences -> External Tools
    So, in Android, SDK fill with: C:/Users/"UserNameWithoutQuotations"/AppData/Local/Android/android-sdk.
    And in JDK: C:/Program Files (x86)/Java/jdk1.7.0_71

    Worked, I have only to try the apk on device. :)
     
    luma2057 and fondemzelgames like this.
  27. Timberduckk

    Timberduckk

    Joined:
    May 6, 2015
    Posts:
    3
    C:\Users\User\AppData\Local\Android\sdk1

    Solved my problem.
     
  28. csam11000

    csam11000

    Joined:
    Jun 1, 2016
    Posts:
    1
    C:\Users\User\AppData\Local\Android\sdk1
    thanks man!!!
     
  29. josman90

    josman90

    Joined:
    Jul 12, 2016
    Posts:
    1
    Nice comment! finally on the money, thanks
     
  30. Ederdoski

    Ederdoski

    Joined:
    Jul 29, 2016
    Posts:
    1
    ME SALVASTEEEEE !
     
  31. allenwithno3

    allenwithno3

    Joined:
    Dec 24, 2016
    Posts:
    2
    i installed the Adroid Studio and finished PATH and CLASSPATH
     
  32. Gerard89

    Gerard89

    Joined:
    Jan 19, 2017
    Posts:
    1
    Puedes buscar la dirección abriendo Android Studio- Preferences- Appearence y Behaviour - System Settings - Android SDK. Copias la direccion que te aparece. En mi caso es /Users/gerard/Library/Android/sdk porque gerard es mi usuario. Luego en Unity , en preferencias das en External tools y donde dice SDK pegas la dirección. Lo digo de esta forma porque en Mac no deja buscar la dirección cuando haces build porque la carpeta lybrary esta oculta, intente desocultarla pero aun así no dejaba desde build, por eso di el procedimiento anterior y así funcionó correctamente.
     
  33. Farresto

    Farresto

    Joined:
    Jan 20, 2016
    Posts:
    9
    When I tried selecting the Android SDK folder, it basically re-opened the explorer window pop up (like if I selected the wrong folder).

    I re-installed the Android SDK, but found that it did not solve my issue.

    In the end, I discovered that I had accidentally added the JDK folder within the Android SDK folder. I moved the JDK folder out of the way, and it solved the issue.

    It seems Unity doesn't like extra folders in there :)
     
  34. RyanLBuchanan

    RyanLBuchanan

    Joined:
    Apr 28, 2017
    Posts:
    1
    I've tried all of the above suggestions - with several version of unity including 5.3.3, 5.5.0 & 5.6.0.
    Downloaded NDK 10e
    deleted from command line & reinstalled both Unity & Android Studio/SDK
    And used preferences - external tools to set paths ...
    Still getting issue: check SDK path
    I've set up folder pathway to "C:\Users\User\AppData\Local\Android\sdk1" on my PC
    & I've set a similar path on my Mac.
    Neither are working.
    I'm very new to developing but, please guys, is it this difficult?
    Is there something simple that I missed, please?
     
  35. jimver04

    jimver04

    Joined:
    Apr 13, 2016
    Posts:
    17
    luma2057 and UnityLighting like this.
  36. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    @jimver04 this is not the correct way to solve the issue. You must update your Unity to the latest patch release, and the SDK Tools in Android studio.
     
    luma2057 likes this.
  37. DoenitZ

    DoenitZ

    Joined:
    Oct 23, 2012
    Posts:
    16
    @jimver04 Thank you for this. That IS the effective way of solving this issue when you can't update your unity version in large projects that involve a huge amount of external plugins that will broke when you upgrade your project (and where you can't spend the time to do that as you are running against time to get a build done)
    But bear in mind, that this can break your android studio needs for the SDK. You can later update to 25.2.2 version after doing this to ensure that everything will work afterwards

    If instead, you can do a clean update to the latest unity version, then do that instead, as Yuri mentioned

    In any case, here are the links, that are in the Stack Overflow question, in case that someone needs them later
    Windows: https://dl.google.com/android/repository/tools_r25.2.3-windows.zip -

    MacOSX: https://dl.google.com/android/repository/tools_r25.2.3-macosx.zip -

    Linux: https://dl.google.com/android/repository/tools_r25.2.3-linux.zip
     
  38. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    513
    @Yury-Habets

    Hi, I've just noticed a strange problem when using latest Unity and latest Android SDK tools. When building the project it creates a different AndroidManifest.xml, with duplicate permissions and also adds an unnecessary
    READ_PHONE_STATE permission. That's how I noticed this bug.

    I suspect latest Unity fix that allows the use of new SDK tools is the culprit.

    I was able fix that by reverting back to the above version: tools_r25.2.3-macosx.zip

    I've tested that with both Unity 5.5.3p4 & 5.6.1p1 with exact same project. When using tools 25.2.3 it creates a correct manifest but if I use 26.0.2 (latest) manifest is bugged.

    I'm attaching a zip file with two manifest files (taken from StatingArea) for the exact same project and the only difference is the tools version.
     

    Attached Files:

  39. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    @PixelEnvision this is extremely interesting. Is it the same for you on an empty project? Maybe the new tools enable some new functionality in your project? Maybe you enabled some new services?

    Since I've seen something like this mentioned - can you please submit a bug report? We definitely don't want this permission.
     
  40. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    513
    @Yury-Habets thanks for the reply.

    I haven't tested it with an empty project and unfortunately there is no bug report as the project is very big and I didn't want to submit one without a repo. But the project uses TapDaq ad mediator with Unity & Vungle video rewards plus Google Game Services. So, it's a bit messy in the Plugins/Android folder. But everything complies & works fine with 25.2.3. And for above files, I even didn't close the unity editor. I've just replaced the tools folder and re-build.

    On another note, I'm currently using Unity 5.5.4 and yesterday I've tried upgrading Android SDK Tools to latest (26.0.2) and I couldn't build the apk with a merge error. Reverted back to 25.2.3 and it's working now. So, it looks like that problem doesn't seems to be fully fixed now.
     
  41. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Could you share your build error with 26.0.2?

    On the permission - we could try to handle your big project. Otherwise, after building your project with SDK tools 26, examine Temp/StagingArea folder, search for the manifests and try to find mentions of READ_PHONE_STATE.
     
  42. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    513
    @Yury-Habets

    I've upgraded SDK Tools to 26.0.2 and this is the build error using Unity 5.5.4p1

    First line
    Code (CSharp):
    1. Error: Error while saving blame file, build will continue
    2. Error: The prefix "tools" for attribute "tools:overrideLibrary" associated with an element type "uses-sdk" is not bound.
    3.  
    4. UnityEditor.HostView:OnGUI()
    5.  
    Second Line (logged twice)
    Code (CSharp):
    1. AndroidSDKToolsException: Unable to merge android manifests. See the Console for more details.
    2. UnityEditor.Android.AndroidSDKTools.DetectErrorsAndWarnings (System.String logMessages, System.String errorMsg)
    3. UnityEditor.Android.AndroidSDKTools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    4. UnityEditor.Android.AndroidSDKTools.RunCommandSafe (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    5. UnityEditor.Android.AndroidSDKTools.RunCommand (System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    6. UnityEditor.Android.AndroidSDKTools.RunCommand (System.String[] sdkToolCommand, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    7. UnityEditor.Android.AndroidSDKTools.RunCommand (System.String[] sdkToolCommand, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    8. UnityEditor.Android.AndroidSDKTools.MergeManifests (System.String target, System.String mainManifest, System.String[] libraryManifests, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit)
    9. UnityEditor.Android.PostProcessor.Tasks.GenerateManifest.MergeManifests (UnityEditor.Android.PostProcessor.PostProcessorContext context, System.String targetManifest, System.String mainManifest)
    10. UnityEditor.Android.PostProcessor.Tasks.GenerateManifest.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    11. UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    12. UnityEditor.HostView:OnGUI()
    13.  
    Regarding your suggestion, it was the first thing I did. I've scanned both full unity project folder & Temp/Staging area folders but there were 0 references to READ_PHONE_STATE anywhere including the other manifests in the sub folders.

    EDIT: I've also scanned for device id calls in project as I know it can add this permission and there weren't any. But again, same project builds fine with the older SDK tools, welcome to the twilight zone. :)
     
  43. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    The "Unable to merge manifests" entry should be longer and contain the details.

    On the permission - can you please submit a bug report? It sounds to me there's a bug in Android tools. Thanks!
     
  44. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    513
    It was all there there is for the merge error. I'll try to build a repo case and submit bug report for both...
     
  45. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    The difference between tools 25.x and 26.x is that newer versions feature new Manifest merger class, which we are using because the old one is no longer available.
     
  46. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    513
    @Yury-Habets I've just submitted a bug report with a repo project for the merge error, Case 924792

    I'll now try to make a repo case for the permission issue...
     
  47. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    513
    @Yury-Habets Bug report for the permission issue also submitted with a repo project, Case 924794

    Btw, it truncated so READ_PHONE_STATE is not visible on the title.
     
  48. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    PixelEnvision likes this.
  49. 19cruz93

    19cruz93

    Joined:
    Jul 28, 2017
    Posts:
    1
    C: / Usuarios / PC / AppData / Local / Android / sdk

    mita es la ruta
     
  50. Greenfriendly

    Greenfriendly

    Joined:
    Nov 2, 2017
    Posts:
    1
    Finally, this worked! Kudos!