Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio runs old code BUT JUST SOMETIMES. It is fricking annoying

I use Android Studio 4.1.1

Sometimes when I edit/add new code to my project, it doesn't refresh. AS simply runs the old code. Sometimes I have to add empty new lines and run it again to make my modifications effect.

I would like to turn off every caching and smart speed run bs in order to make this laughable death star IDE work for once in the life, doing one thing properly, instead of doing 1000 things badly.

How is it possible that when they make an update, fixing/adding 2 new things but make worse/broke 3 old ones?

I tried to turn off instant run but it is not even among options.

Thanks in advance.

like image 586
Adam Varhegyi Avatar asked Feb 25 '21 15:02

Adam Varhegyi


People also ask

Is it painful to work with Android Studio?

The masterpiece called Android Studio is painful to work with: I can't help but seek your help with a following problem: Once I ran some code, changed it a few times since then, but no changes were actually made and studio keeps running the old code (which does not even exist anymore).

How do I know what version of Android SDK I have?

Look in the SDK Manager what is your highest Android SDK Build-tools version, and copy this version number in your project build.gradle file, in the android/buildToolsVersion property (for me, version was "18.1.1"). File->Project Structure->Project pane->"Android plugin version".

Why is my code being pushed to run without warning?

;)) This is happening because there is error in your code and you have selected run without warning when error in program exists. In such a case the last successfully built code would get pushed!


2 Answers

Try this settings:
Run -> Edit Configuration...

1 2

like image 53
oleg.svs Avatar answered Oct 25 '22 04:10

oleg.svs


Try #1: Update to the latest distributions Gradle in gradle-wrapper.properties file and clean project.

# 6.8.2
distributionUrl=https\://services.gradle.org/distributions/gradle-<latest-version>-bin.zip

Try #2 (A temporary alternative): Use the Android Studio beta version in the meantime there is a new AS version.

like image 20
Wilson Tran Avatar answered Oct 25 '22 05:10

Wilson Tran