Android IDE (AIDE) Support Forum

Need to Refresh Build each time before changes appear in compiled app

Hi everyone. I wonder if anyone can point me in the right direction with this new behaviour that seems to be a part of the project I am working on recently-
I have a project I’m writing in Java and recently I renamed a function in my code as follows:

MyFunction() changed to MyFunction_oldVersion()

and I created a new MyFunction() to replace the previous one. I kept the names so I could change back if I needed to without deleting all of the old version code.

However I now find that every time I “run” (compile) the app it doesn’t show any changes I made anywhere in the code. I have to do REFRESH BUILD and then run the app for the changes to take place.

Is this something to do with my renaming and reusing the name of a function in the code? Or is that perhaps a red herring?

Is there some kind of cache that I should clear? Or perhaps start a new project and copy all my code across to “clean” it all up? Has anyone else found this or a similar problem?
I can cope with it - refreshing the build each time isn’t life and death but its time consuming and I like to find why weird things like this happen.

I’m running AIDE
version 3.2.200127

on a Huawei P Smart mobile phone with Android P

Many thanks
kind regards
Sam (AMF3)

It was a normal bug in AIDE. Sometimes it compiles with old code, even when the new code got error.
This bug appear more frequently when the code file larger.
I’m always using KillApps to kill AIDE service completely each time I changed the code. It’s faster and often skip bug better, because I got many case that rebuild not worked correctly (Maybe the bug still there when service running)

Also, the app compact library can made it even worse. If you imported app compact and the project has a lot of resource, the finding error engine will start working wrong. Example the array like this will have no error: new int[]{1,2,3,4,}. And it will compile with old code data. Or all resource R.raw.* will got error not found, even it was correct 1000% :clap::joy_cat:. To fix this, I need to kill AIDE service first. Then disable the appcompact in build.gradle ( /**/ or // ) and Ctrl+S, then re-enable it and tap run. It will recheck correctly.

1 Like

Thank you very much for this info :slight_smile:

It’s been more than a year that I have this same issue.
The best workaround I found is to edit a xml file, f.e. layout.xml, before compiling. (Adding/Removing a random space character does the trick)

2 Likes

Thanks :slight_smile: I shall try this. It will be good to have that option as a workaround.

Meanwhile the bug report has been forwarded to the developers.

Hello!
Just change Build Variants to Release.
In debug mode, new changes not applyed. If you need to debug mode, can change Build Variants to Debug everytime you need this.

1 Like

Hi
That is very interesting. My system has been on debug build variation, so I will try what you say.
I wonder why it should make a difference.
I’ll report back with my findings.

Thanks :slight_smile: