Android Studio "active developer path” Compiling Error in MacOS

Description of Issue: 

When Rebuilding project Android Studio under MacOS-Sierra, you maybe surprised to see theses error messages:

Error:error: active developer path ("/Users/judicael/Downloads/Xcode.app/Contents/Developer") does not exist

there is a screenshot of Android Studio output as generated in my case:

Notice : This error can be reproduced if your Android Studio is installed side by side with Xcode and Android NDK Tools is installed along with your SDK manager.
How this error occurs:

This issue occurs when developer Install Android Studio (including NDK tool)  side by side with Xcode  , Android studio internally uses Command line Tools from MacOS ,  Command line Tools are not shipped by default in Mac OS , It can be installed as a developer option by Android studio or Xcode 

You can manually install Command line Tools with the following command line in Terminal
CMD=> xcode-select —install

When Xcode is installed alongside with Android Studio , CommandLines Tools will be overridden by Xcode , you can see its current path with the following command in terminal

CMD=> xcode-select --print-path

It should print this path:

/Applications/Xcode.app/Contents/Developer

If it’s not the case and ,it prints a wrong or fake path as we have seen such as :

/Users/judicael/Downloads/Xcode.app/Contents/Developer


Then your Android Studio may generate errors :

Error:error: active developer path ("/Users/judicael/Downloads/Xcode.app/Contents/Developer") does not exist

How to fix it:

1) Run Xcode , then from menu Xcode-Preference 


2) Now select Location tab :

The issue is here he combobox for Command line Tools is probably empty! and that is the root cause of the problem!

3) select your Xcode version and save & exit


4) No Restart Android Studio and then Clean & Rebuild your project 

5) Make sure this folder has been created successfully by going to /Library/Developer

:


The issue is now fixed!


April 19 , 2017

Khosrov

 © Xosrov 2016