0

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

3 Answers 3

2

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 .

Sign up to request clarification or add additional context in comments.

2 Comments

wow, your method which I had tried before but didnt work. but don't know why, the ionic cordova platform remove android command is working now! Thanks!
:), I could not delete the platform before, because the google-services.json is used by another program. (Which I have no idea). My current approach was to sleep the computer or restart the computer to stop that program from stopping the deletion :) Thanks
2

For me it was because I had platform/android folder open in android studio After running ionic cordova platform remove android the folder was always there Just close the project in android studio and run the command from another terminal

Comments

0

I have the same error. In my case the solution was detect that process had catch the folder, (adb.exe).

Then I killed the process and I could execute ionic cordova platform rm android, and then add platform again.

If you can't detect the process, you can restar the pc and try again.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.