Thomas Kim
Thomas Kim

Reputation: 513

Ionic 5 capacitor android project not sync

Android studio keeps building and install the first android project into the device.

I have tried

npx cap sync

npx cap copy android

Even delete the /android folder and add it again. The project still remains as the first time I added into the android studio. I have tried 'Gradle sync' and 'Invalidate cache /restart' still no luck.

I have update my project resource icon and splash to a customized one, but the android project still using the capacitor default icon and splash. Have anyone face this issue before?

Upvotes: 3

Views: 9721

Answers (3)

Aaron Saunders
Aaron Saunders

Reputation: 33335

if you are using the ionic commands the all you have to do is call ionic capacitor sync... it will do all of the building and the copying of assets

https://ionicframework.com/docs/cli/commands/capacitor-sync

Upvotes: 1

Neha Shah
Neha Shah

Reputation: 1247

Every time you perform a build (e.g. ionic build) that changes your web directory (default: www), you'll need to copy those changes down to your native projects:

  1. ionic build or npm run build
  2. npx cap copy
  3. npx cap open android

reference : https://capacitor.ionicframework.com/docs/getting-started/with-ionic

Upvotes: 4

Thomas Kim
Thomas Kim

Reputation: 513

I found the solution!

I notice the npx sync is copying data from the www folder. Thus, I think I need to update the www folder first before sync. Thus I use the

ionic build

Command, to build all the files into www and run

npx cap sync 
npx cap open android

Tada, android project is updated.

Upvotes: 9

Related Questions