[SOLVED] Ionic cordova run android on windows


#1

On my windows 10 pc
cordova 7.1.0
ionic 3.16.0
npm 5.5.1

I run ionic cordova run android but I obtain the following error:

Error: Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable.
[ERROR] An error occurred while running cordova run android (exit code 1).

Now It could be clear, but I installed Android Studio and my android sdk is placed under

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

I set my ANDROID_HOME environment variables and I added it also on my PATH variable.

C:\Users\Utente\AppData\Local\Android\Sdk\tools
C:\Users\Utente\AppData\Local\Android\Sdk\platform-tools

I don’t understand why I continue to obtain the error above. If I type android or if I type echo %ANDROID_HOME% from cmd, all seems correct!

Please, anyone have a solution?

[SOLVED]

I reinstall Android Studio and also

cd in my project folder

ionic cordova platform rm android

and then

ionic cordova build android