Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Android Studio and Visual Studio safely share the same Android SDK?

I'm trying to free up some disk space and so would like one copy of the Android SDK only, aside from not wanting to maintain two of them. Currently I have one installed for each Android Studio and Visual Studio.

I noticed that there is now a separate, Xamarin specific Android SDK manager that Visual Studio uses in place of the one provided by the Android SDK itself.

Also, Visual Studio's Android NDK is located at "C:\ProgramData\Microsoft\AndroidNDK". I don't recall installing it there specifically (probably used a default location), but suppose Android Studio could be pointed at it as well.

like image 451
samus Avatar asked Jun 18 '18 16:06

samus


Video Answer


1 Answers

Can Android Studio and Visual Studio safely share the same Android SDK?

The answer is Yes, I have done this for a long time and it works fine.

enter image description here

In Visual Studio, Xamarin Android SDK default location is:

C:\Program Files (x86)\Android\android-sdk

C:\ProgramData\Microsoft\AndroidNDK64

In Android Studio, SDK default location is:

C:\Users\username\AppData\Local\Android\Sdk

C:\Users\username\AppData\Local\Android\Sdk\ndk-bundle

Use Visual Studio Android SDK only

You could refer to my answer:

  1. Open Android Studio, go to File -> Project Structure

  2. Change the SDK location to your Visual Studio SDK Location

    • a. Change it to Xamarin Android SDK Location: C:\Program Files (x86)\Android\android-sdk
    • b. There is a problem when you change the SDK Location: cannot contain whitespace. You could open CMD as Administrator and type: mklink /J C:\Program-Files-(x86) "C:\Program Files (x86)", like this.
    • c. Then you could change the SDK Location, effect.

Use Android Studio Android SDK only

You just need change Xamarin Android settings as the above picture. You could find it in:

Tools -> Options -> Xamarin -> Android Setting

It is that new visual studio specific sdk manager I'm worried about.

As @Muhammad said, it won’t broke anything.

like image 138
York Shen Avatar answered Oct 11 '22 13:10

York Shen