I am experiencing an issue with Gradle builds. Whe...
# gradle
z
I am experiencing an issue with Gradle builds. When I attempt to run my Android application, Gradle uses cached artifacts instead of building with my latest changes. As a result, I must rebuild the application every time and I haven't enabled caching. How can I resolve this issue?
not kotlin but kotlin colored 3
c
Since you have not enabled caching, this can happen if Gradle thinks something is UP-TO-DATE when it isn't. To debug this, when executing the build, look at the executed tasks:
Copy code
> Task foo:bar
> Task foo:foo UP-TO-DATE
> Task foo:oof
In this example, Gradle considered that
foo:foo
was UP-TO-DATE. You can find them in the "build", "run" or "services" tab at the bottom-left, depending on how you run your app. First, you should reproduce the problem you mentioned (gradle not recompiling when you thought it should have). Then, look at the executed tasks and find which ones are marked UP-TO-DATE when you think they shouldn't be. Once you know which tasks are the problem, do it again with
--info
(CLI analysis) or
--scan
(HTML report analysis). Find the task you have a problem with, and it will say way it thinks it's up-to-date, then you can go from there.
z
I think I found the problem. When I run the
./gradlew assembleDebug
command on the terminal, everything works fine. However, when I click the Run button in Android Studio, the app is not updated.
c
You should probably ask in https://discord.com/invite/D2cNrqX
👌 1