Cordova Error: Android SDK not found. Make sure that it is installed

I recently tried to upgrade Cordova app which was last compiled almost an year back and got 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.

I turns out that I had updated Android SDK version on my PC during that time and all I needed to do was to update the platform version in the app as well.

Using Node.js Command Prompt and cordova commands, check the installed platform in the app using the following command

cordova platform version android

Update the installed platform version in the app using the following command

cordova platform update android

While upgrading the app additional issues I faced were related to plugins not being compatible with the new platform version which were fixed by simply removing the plugins and re-adding it which in some cases also involved code changes.

Commands to remove and add cordova plugins

cordova plugin remove <plugin>

cordova plugin add <plugin>

 


Leave A Comment

Your email address will not be published. Required fields are marked *