Ad

Platform Android Already Exists. Ionic Cordova Cannot Add Platform

- 1 answer

I have run into an error when cordova build. So I decided to do a cordova clean and cordova build. But the error persists saying something wrong with aapt. Some answers online said it might be a google.support version problem. So I did ionic cordova rm android, and removed my android from my project.

But when I tried to ionic cordova add android. It always shows me Platform android already exists.. I have been searching online but could not find a similar question.

I tried to delete the platforms folder, and add platform again. Still the same error. But when I reopen that project. platforms folder will be added back automatically which this structure inside.

enter image description here

Ad

Answer

run ionic cordova platform remove android and check if the syntax run successfully and if the folder was deleted ,and remember to close all files or folders opened in the same path . run ionic cordova platform add [email protected] or any other version .

Ad
source: stackoverflow.com
Ad