Android Studio skips building after a library aar file is updated

33 views Asked by At

The structure of an Android library module is like the following:

FooLib
 gradle
 build
 libs
  foo.aar
 src

build.gradle:

plugins {
    id 'com.android.library'
}
...
dependencies {
    compileOnly files('libs/foo.aar')
    ...
}

Run assembleRelease builds the library aar file foolib-release.aar in /build/outputs/aar. foolib-release.aar is used by a few apps and works fine.

Here is the issue: when I update foo.aar manually by using Windows 11 File Explorer (i.e., replace foo.aar with a new one) and run assembleRelease, Android Studio gives a long list of things like the following and does not do anything.

> Task :FooLib:bundleReleaseAar UP-TO-DATE
> Task :FooLib:createReleaseVariantModel UP-TO-DATE
> Task :FooLib:mapReleaseSourceSetPaths UP-TO-DATE
> Task :FooLib:mergeReleaseResources UP-TO-DATE
> Task :FooLib:verifyReleaseResources UP-TO-DATE
> Task :FooLib:assembleRelease UP-TO-DATE

foolib-release.aar is not rebuilt. The Run window shows the following:

BUILD SUCCESSFUL in 1s
29 actionable tasks: 29 up-to-date
Configuration cache entry stored.

It was not the case not long ago. Android Studio used to build a new release after a library aar was modified. Could anyone shed some light on this and offer a tip on how to revert Android Studio to its old behavior in this regard?

0

There are 0 answers