'tns run android' - Starts up fine but terminates with error any time a change is made to code

android

#1

I’m having an issue whilst running a blank app based on this template

I start the app using ‘tns run android --emulator’ and it starts up fine and installs on the emulator. The app opens and everything looks fine - but then if I make a change I get this error message:

Executing before-prepare hook from C:\workspace\apps\football-nativescript-app\hooks\before-prepare\nativescript-dev-typescript.js
Hook skipped because either bundling or livesync is in progress.
Preparing project…
Executing before-prepareJSApp hook from C:\workspace\apps\football-nativescript-app\hooks\before-prepareJSApp\nativescript-dev-webpack.js
Unable to apply changes for device: emulator-5554. Error is: EPERM: operation not permitted, mkdir ‘C:\workspace\apps\football-nativescript-app\platforms\android\app\src\main\assets\app\home’.
Executing after-watch hook from C:\workspace\apps\football-nativescript-app\hooks\after-watch\nativescript-dev-typescript.js
Stopping tsc watch

I’ve tried a few other templates and I’m getting the same issue. Any help would be appreciated!


#2

Delete your hooks folder and npm_modules folder and also platforms folder

And do, npm install
Then, tns run android


#3

Thanks for the reply.

This solves the problem temporarily, but if I have to Ctrl+C to end the process and restart the problem comes back. Is it a normal build process to have to delete and reinstall every time you start up the android emulator? It’s very time consuming.


#4

No, this is not normal. Can you share your package.json here?

I only want to see the dependencies and dev-dependencies


#5

It’s stopped doing it now. Thanks for your help.