2

When i run build.gradle in as, warning "Error:ANDROID_HOME is not set. If it has been set, please be aware environment variable conflict with ANDROID_SDK. Expression: false" and build failed.

So i check my system variables, the ANDROID_HOME is exist.

Anyone who knows how to solve this problem?

li_shen
  • 23
  • 6

2 Answers2

3

Please once check your environmental variable path and android studio SDK path should be same. Consider this case, If you are having two SDK folders one is target to Android studio another one for environmental variable, At the time this kind of problems may occur. Any way once reset both places path (i.e Android Studio, Environmental Variable) properly then restart PC and check.

for setting ANDROID_HOME Follow this link

Community
  • 1
  • 1
Ravi Jaggarapu
  • 627
  • 3
  • 10
0

for windows:

set ANDROID_HOME=C:\\android-sdk-windows

set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools

johnrao07
  • 6,690
  • 4
  • 32
  • 55
  • I have add these system variables into PATH, but didn't work – li_shen Dec 19 '15 at 09:43
  • According to: http://superuser.com/questions/949560/how-do-i-set-system-environment-variables-in-windows-10 you need to be an administrator not user on your PC – piotrek1543 Dec 19 '15 at 09:49
  • after changing the environment variables you'll need to restart the application (in this case android studio) and sometimes the changes in environment variables reflect only after s system restart. Did you restart android studio or system and then try? – Viral Patel Dec 19 '15 at 09:54