0

This is something weird,

first I set ANDROID_HOME in environment variable, and phonegap CLI was working properly, after that I installed android studio. It asked me to avoid ANDROID HOME path with spaces(I had space in path like: D:\Backup data\Android\sdk), then I removed space and updated the environment variables, both ANDROID_HOME AND PATH.

Now When I tried to run phonegap build android I get

The SDK Directory D:\Backup data\Android\sdk does not exist.

I tried setting it through cmd prompt as given here.

Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.

But did not work either. Also tried restarting the system and setting the variable in system variable section of environment variables.

Please guide me on this.

The new path is D:\Backupdata\Android\sdk, Backupdata is without space.

Community
  • 1
  • 1
PhpCoder
  • 427
  • 6
  • 20
  • I have removed the space between "Backup" and "data" for android studio. so now it is "D:\Backupdata\Android\sdk", without spaces. but in the error it is still showing old path. – PhpCoder Jan 24 '17 at 15:12

1 Answers1

0

Found the answer, for Phonegap android users,

the path is set in {Yourapp}\platforms\android, in the local.properties file.

sdk.dir=D\:\\Backupdata\\Android\\sdk

like this.

This was because first time I ran android studio the path was the old one with space, but after changing the path(without space), I never opened android studio, As this file is automatically generated by android studio.

Now it will be again overwritten by android studio next time I run it.

Hope this helps some one.

PhpCoder
  • 427
  • 6
  • 20