Android studio 3.1 rebuild project each time to see the changes

蹲街弑〆低调 提交于 2019-12-10 20:23:59

问题


After updating my android studio to version 3.1,I have a problem which is :

When I make some changes on my code , then I launch the execution , I get the old execution of code , until I'll rebuild the project or clean it and try again is that a problem ?

PS : this happened with my old projects , i did not tried yet with new projects


回答1:


I think you’re facing a BUG in android studio, as declared by google via Twitter.

I quote their 3 tweets:

We've identified an error that affects some users upgrading from AS3.0: source files may not automatically rebuild when running or debugging an application. Please add 'Gradle aware make' to pre-launch steps in the Run Configuration or wait for AS3.1.1 hotfix early next week[1/3]

Also around the time of the release, jCenter (a 3rd party repository which hosts many of the libraries used by Android developers) suffered from an outage (read more on http://status.bintray.com/ ). This caused builds to fail and was an unfortunate coincidence. [2/3]

Even though this was something out of our control, we will try to come up with a way to mitigate this in the future. We apologize for any problems and ask all developers to test your projects on our weekly Canary (and soon Beta) versions of Android Studio and file bugs. [3/3]

Accompanied by their image:

source: https://twitter.com/androidstudio/status/981914636739076097




回答2:


Strange, but in Android Studio 3.3.1 I recently had gotten this bug. Nothing changed in AS, but problem appeared. I uninstalled AS, but nothing changed. I could revert to any commit in Git, but had to rebuild a project every time in order to compile.

So, a solution from https://stackoverflow.com/a/49525674/2914140 and @Martin Marconcini helped me. I added Gradle-aware make (leaving Task empty).

In my case I didn't add Instant App Provision because turned off Instant Run.

UPDATE

After several days I noticed that compile time had increased. When I removed that task, AS again didn't change the build. So, I added the task again.



来源:https://stackoverflow.com/questions/49701214/android-studio-3-1-rebuild-project-each-time-to-see-the-changes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!