Use same Android SDK path as Android Studio

kenken Member
edited December 2017 in Xamarin.Android

Hi

I have Android Studio and Visual Studio Enterprise 2015 with Xamarin installed. Earlier, I developed Android Apps with Android Studio and want to move to cross platform developing using Xamarin. In order to prevent having multiple folders with same Android sdk versions, I pointed the sdk folder in Xamarin ("Tools>Options>Android Settings") to "C:\Users*USER*\AppData\Local\Android\Sdk".

But after that, I can't open the Emulator AVD menu or SDK manager and I can't compile any code. I assume it does not recognize?

Does anybody had same issues and is there a fix for that? Or do I have to re-download the sdk to the given default path with Xamarin?

Best Regards.

Posts

  • knottydevknottydev USMember ✭✭

    I am on VS2017 but my sdk location is: C:\Program Files (x86)\Android\android-sdk. I don't have anything in AppData\Local (no Android folder). I'm confused as to why you'd want to change this? But, maybe something changed since you last created Xamarin solutions in VS or maybe it's because we are on different versions of VS.

    What SDK version are you using?

  • kenken Member

    @knottydev said:
    I am on VS2017 but my sdk location is: C:\Program Files (x86)\Android\android-sdk. I don't have anything in AppData\Local (no Android folder). I'm confused as to why you'd want to change this? But, maybe something changed since you last created Xamarin solutions in VS or maybe it's because we are on different versions of VS.

    What SDK version are you using?

    I'm on VS2015. But in the mean time I solved my issue by manually downloading the latest sdk tools from Android and manually extracting the files in to the folder.

    But the next problem I encountered was, that the code is not deploying to the emulator. I am working now for a solution.

  • mikeacostamikeacosta USUniversity ✭✭✭
    edited January 2018

    Sorry, I don't have a specific sol'n to your issue, just some input based on my experience.

    I maintain separate SDK locations for AS and Xamarin. I use the SDK & AVD Managers in AS to install system images and emulators. When the emulator is started up (I created a command line script to start the emulator so I don't always have to open AS to do that), Xamarin recognized and deploys to it. I don't install any system images with the Xamarin Android SDK Manager, saving a ton of disk space. I do this on both Windows and MacOS, and it works fine.

    In the past, I've tried to share the same SDK between native Android and Xamarin but would ultimately run into issues with a library or something on either platform looking for the SDK in a specific directory path (or portion of it) and not finding it. Sure, there's the add'l step of ensuring API levels, build tools, etc. are up to date for both IDEs, but it's hardly a burden. A very small trade off for the benefit of avoiding any potential issues that WILL arise when trying to share the SDK.

Sign In or Register to comment.