Android Studio not recognizing changes

Hi,
For some reason, when I make a change to my code, and then build it: ionic build, ionic capacitor copy, the change is not picked up in the Android Studio. When I run the app, some old version of the code is ran on the app.

I am really stuck on this, any help would be appreciated.

Ionic:

Ionic CLI : 5.4.16 (C:\Users\craig\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 5.0.5
@angular-devkit/build-angular : 0.900.6
@angular-devkit/schematics : 9.0.6
@angular/cli : 9.0.6
@ionic/angular-toolkit : 2.2.0

Capacitor:

Capacitor CLI : 1.5.1
@capacitor/core : 1.5.1

Cordova:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : none
Cordova Plugins : no whitelisted plugins (0 plugins total)

Utility:

cordova-res : 0.10.0
native-run : 0.3.0

System:

NodeJS : v12.15.0 (C:\Program Files\nodejs\node.exe)
npm : 6.13.4
OS : Windows 10

npx cap copy is just updating your “template”, you need npx cap sync to update your plugins.

Indeed that’s what I do whenever I want to test my changes:

ionic build --prod && npx cap copy && npx cap sync && npx cap open android

the double & operator will allow you to do all this stuff one-by-one in sync mode.

After that I recommend to do **Build** -> **Clean Project** before launch your app.

Let me know if it works!

4 Likes

Thanks for you help. There are some good tips there.
It looks like my app had Ionic Deploy enabled, so it was installing the right one, then over-writing it in the background with whatever old version was available via Ionic Deploy.
Painful, I lost so much time on this.