- 1 year ago
Cordova "Create your first Cordova app" can't get pass "Android target: not installed"
If you are encountering the "Android target: not installed" issue while following the "Create your first Cordova app" tutorial, it means that Cordova is unable to find a suitable Android target for building the app. This can happen if the required Android SDK components are not installed or if the SDK path is not set correctly. Here are some steps to help you resolve the issue:
Install Android SDK Components:
Make sure you have installed the necessary Android SDK components using the Android SDK Manager. To do this, open Android Studio and go to "File" > "Settings" > "Appearance & Behavior" > "System Settings" > "Android SDK." Check the required Android SDK Platforms and Tools under the "SDK Platforms" and "SDK Tools" tabs, and click "Apply" to install them.Set Android SDK Path:
Ensure that Cordova can find the Android SDK on your system. You can set the Android SDK path by using theANDROID_HOME
environment variable. Open the Windows Control Panel, go to "System and Security," then "System," and click on "Advanced system settings." In the System Properties window, click on the "Environment Variables" button, and add a new system variable namedANDROID_HOME
with the value set to the path of your Android SDK installation (e.g.,C:\Users\YourUsername\AppData\Local\Android\Sdk
).Set PATH Environment Variable:
Make sure that the Android SDK'stools
andplatform-tools
directories are included in thePATH
environment variable. Open the "Environment Variables" window as mentioned in the previous step, and edit thePATH
variable to include the following paths:perl%ANDROID_HOME%\tools
%ANDROID_HOME%\platform-tools
Update SDK Build Tools:
Ensure that the build tools specified in the Cordova project'sconfig.xml
file are installed. Open theconfig.xml
file in your project's root directory and check the<engine>
tag for the specified Android platform version and the required build tools version. Make sure that you have installed the specified build tools using the Android SDK Manager.Update Cordova Platforms:
Try updating the Android platform for your Cordova project using the following command:sqlcordova platform update android
Restart Command Prompt or Terminal:
After making changes to the environment variables or installing SDK components, close and reopen the Command Prompt or Terminal window to ensure that the changes take effect.Check for Errors:
If you encounter any error messages during the setup process, carefully read and analyze them to get more information about the issue.
After completing these steps, try creating your Cordova app again. The "Android target: not installed" issue should now be resolved, and you should be able to proceed with building your Cordova app for Android.