Npm run build does not make web assets directory ./www

Hi I had built an android app in android studio for Google play (a beta version). I made some changes to my code and am trying to upload a new version of the app to Google Play.

I try to do a ionic capacitor build android and I get this error:

Could not find the web assets directory: ./www.
Please create it and make sure it has an index.html file. You can change
the path of this directory in capacitor.config.json (webDir option). You
may need to compile the web assets for your app (typically npm run
build). More info:
Capacitor - build cross platform apps with the web

Other threads related to this say I should run a npm run build. This does not solve my problem. I followed the link for “more info” and don’t really know how it helps. If no one knows the way to solve my issue, can someone point me to a tutorial on what the ./www assets are for and what they do?

Thanks.

Hi,

Not sure if this works or not but give it a try.

→ Take a backup of your code first.

→ Go to capacitor.config.ts

change webDir : 'www’

→ Run the command: Ionic build

1 Like

Ionic now supports multiple frameworks and every framework uses a different folder. www is used for angular, is your app an angular app?

1 Like

React app! I changed it to build instead of www and it works because React builds into build and not www. Thanks!

I just had to change it to build instead of www in the config file and it works because I am making a React app.

1 Like

I have solved changing the path of webDir atribute in capacitor.config.json to the src folder.

webDir: ‘./src’