Status Update
Comments
ja...@gmail.com <ja...@gmail.com> #2
Just select "Build" -> "Rebuild project"
jo...@google.com <jo...@google.com> #3
1. Android Studio version and OS type and version
2. Screenshots or videos of the issue
3. idea.log file (select Help > Show Log in Finder / Explorer)
4. Thread dumps if the issue is a freezing or non-responding UI.
For more information on what’s needed and how to obtain this information please read the guide at
ja...@gmail.com <ja...@gmail.com> #4
You can get all of this in first comment
jb...@google.com <jb...@google.com>
je...@google.com <je...@google.com> #5
This is a very interesting bug but I would file it against Gradle directly if you have done so already. this seems to be an issue with the Gradle's execution engine.
le...@gmail.com <le...@gmail.com> #6
How can this be a Gradle only issue ? We have this issue since Android Studio Hedgehog Canary 11 (not on previous release) and this is not related to any Gradle update (we can reproduce it on Gradle 7+ and 8+).
There is an issue on the Gradle repository but no answers yet.
Please, can you dig deeper into this issue and check why existing projects can't build since Canary 11 ?
Thank you.
ja...@gmail.com <ja...@gmail.com> #7
I think issue in gradle tasks orders when rebuild project (Log for same project with different studio versions) :
// Stable studio version:
Executing tasks: [:android-pdf-viewer:clean, :benchmark_mobile:clean, :benchmark_wear:clean, :liba:clean, :mobile:clean, :wear:clean, :android-pdf-viewer:assembleDebug, :benchmark_mobile:assembleBenchmark, :mobile:assembleProdDebug, :benchmark_wear:assembleBenchmark, :wear:assembleDebug, :liba:assembleDebug]
// Canary studio version (clean modules after build):
Executing tasks: [:android-pdf-viewer:clean, :android-pdf-viewer:assembleDebug, :benchmark_mobile:clean, :benchmark_mobile:assembleBenchmark, :mobile:assembleProdDebug, :benchmark_wear:clean, :benchmark_wear:assembleBenchmark, :wear:assembleDebug, :liba:clean, :liba:assembleDebug, :mobile:clean, :wear:clean]
ja...@gmail.com <ja...@gmail.com> #8
Still broken on canary 14
to...@yahoo.com <to...@yahoo.com> #9
I was on Canary 13 with Gradle 8.2 and Android gradle plugin 8.0.2
I upgraded to Canary 14 and kept Gradle 8.2 and Android gradle plugin 8.0.2
So the only change was Canary 13 -> 14.
Seems to be gradle independent?
Edit: I'm on the Canaries because the stable version is broken; see issue #285577375
Edit2: and just to confirm, yes, building from the command-line WORKS.... it's ONLY failing in Canary 14.
to...@yahoo.com <to...@yahoo.com> #10
Just updated to Canary 15, with Gradle 8.2 and Android gradle plugin 8.0.2 => same problem.
Updated to Gradle 8.2.1 ==> same problem; building from the command-line WORKS.... it's ONLY failing in Canary 14 and 15.
vi...@gmail.com <vi...@gmail.com>
ja...@gmail.com <ja...@gmail.com> #12
ga...@google.com <ga...@google.com> #13
Re #12:
If you run :android-pdf-viewer:clean :android-pdf-viewer:assembleDebug :benchmark_mobile:clean :benchmark_mobile:assembleBenchmark :mobile:assembleProdDebug :benchmark_wear:clean :benchmark_wear:assembleBenchmark :wear:assembleDebug :liba:clean :liba:assembleDebug :mobile:clean :wear:clean
from the command line, do you hit the same issue?
I have reached out to Gradle to reopen the issue on their end, but we'll also try to see if there is something we can do on our end.
ja...@gmail.com <ja...@gmail.com> #14
to...@yahoo.com <to...@yahoo.com> #15
Just to be absolutely clear:
using the graddle binaries and configuration from the IDE and building from the command-line from the terminal inside the IDE ...WORKS.... it's ONLY failing when doing a build from the menus/buttons in Canary 14 and 15.
Also, for me at least, it only seems to affect my multi-module projects. Single module projects build fine.
ja...@gmail.com <ja...@gmail.com> #16
ga...@google.com <ga...@google.com> #17
Re #14, #15:
Android Studio builds a list of tasks and asks Gradle to execute it. The order of tasks in the request should not matter, it is responsibility of Gradle task execution machinery to determine the order in which it can execute them. Now, because there is a bug in Gradle (
Can someone please upload a sample project that reproduces the problem so that I can pass it to Gradle?
In the meantime, we can work around this issue in Android Studio putting the clean
tasks first in the list.
Answering questions from #14:
Why if i do rebuild i got clean project instead? How should it work?
Rebuild project means that we want to remove the old outputs and request a new build, and running clean
tasks is a way to accomplish that.
Are you sure that the problem is not in building a list of tasks?
As mentioned above, the order of tasks seems to trigger a bug in Gradle. The task list itself is correct.
ja...@gmail.com <ja...@gmail.com> #18
You can get any project. Just now i checked on
- Clone project
- Import to Android Studio Canary 15
- Click Build -> Rebuild project Result same.
AS generated next list of tasks (clean/assemble/clean/assemble...):
:app:clean :app:assembleDemoDebug :app-nia-catalog:clean :app-nia-catalog:assembleDebug :benchmarks:clean :benchmarks:assembleDemoBenchmark :lint:clean :lint:assemble :ui-test-hilt-manifest:clean :ui-test-hilt-manifest:assembleDemoDebug :core:analytics:clean :core:analytics:assembleDemoDebug :core:common:clean :core:common:assembleDemoDebug :core:data:clean :core:data:assembleDemoDebug :core:data-test:clean :core:data-test:assembleDemoDebug :core:database:clean :core:database:assembleDemoDebug :core:datastore:clean :core:datastore:assembleDemoDebug :core:datastore-test:clean :core:datastore-test:assembleDemoDebug :core:designsystem:clean :core:designsystem:assembleDemoDebug :core:domain:clean :core:domain:assembleDemoDebug :core:model:clean :core:model:assemble :core:network:clean :core:network:assembleDemoDebug :core:notifications:clean :core:notifications:assembleDemoDebug :core:testing:clean :core:testing:assembleDemoDebug :core:ui:clean :core:ui:assembleDemoDebug :feature:bookmarks:clean :feature:bookmarks:assembleDemoDebug :feature:foryou:clean :feature:foryou:assembleDemoDebug :feature:interests:clean :feature:interests:assembleDemoDebug :feature:search:clean :feature:search:assembleDemoDebug :feature:settings:clean :feature:settings:assembleDemoDebug :feature:topic:clean :feature:topic:assembleDemoDebug :sync:sync-test:clean :sync:sync-test:assembleDemoDebug :sync:work:clean :sync:work:assembleDemoDebug :build-logic:convention:clean :build-logic:convention:assemble
If execute in began "clean" tasks and next "assemble" tasks build will correct (This behavior has changed since version 11):
:app:clean :app-nia-catalog:clean :benchmarks:clean :lint:clean :ui-test-hilt-manifest:clean :core:analytics:clean :core:common:clean :core:data:clean :core:data-test:clean :core:database:clean :core:datastore:clean :core:datastore-test:clean :core:designsystem:clean :core:domain:clean :core:model:clean :core:network:clean :core:notifications:clean :core:testing:clean :core:ui:clean :feature:bookmarks:clean :feature:foryou:clean :feature:interests:clean :feature:search:clean :feature:settings:clean :feature:topic:clean :sync:sync-test:clean :sync:work:clean :build-logic:convention:clean :app:assembleDemoDebug :app-nia-catalog:assembleDebug :benchmarks:assembleDemoBenchmark :lint:assemble :ui-test-hilt-manifest:assembleDemoDebug :core:analytics:assembleDemoDebug :core:common:assembleDemoDebug :core:data:assembleDemoDebug :core:data-test:assembleDemoDebug :core:database:assembleDemoDebug :core:datastore:assembleDemoDebug :core:datastore-test:assembleDemoDebug :core:designsystem:assembleDemoDebug :core:domain:assembleDemoDebug :core:model:assemble :core:network:assembleDemoDebug :core:notifications:assembleDemoDebug :core:testing:assembleDemoDebug :core:ui:assembleDemoDebug :feature:bookmarks:assembleDemoDebug :feature:foryou:assembleDemoDebug :feature:interests:assembleDemoDebug :feature:search:assembleDemoDebug :feature:settings:assembleDemoDebug :feature:topic:assembleDemoDebug :sync:sync-test:assembleDemoDebug :sync:work:assembleDemoDebug :build-logic:convention:assemble
Also "should not matter" please check.
./gradlew :android-pdf-viewer:assembleDebug :android-pdf-viewer:clean --info | grep "> Task"
> Task :android-pdf-viewer:preBuild UP-TO-DATE
> Task :android-pdf-viewer:preDebugBuild UP-TO-DATE
> Task :android-pdf-viewer:mergeDebugJniLibFolders UP-TO-DATE
> Task :android-pdf-viewer:mergeDebugNativeLibs NO-SOURCE
> Task :android-pdf-viewer:stripDebugDebugSymbols NO-SOURCE
> Task :android-pdf-viewer:copyDebugJniLibsProjectAndLocalJars UP-TO-DATE
> Task :android-pdf-viewer:generateDebugResValues UP-TO-DATE
> Task :android-pdf-viewer:generateDebugResources UP-TO-DATE
> Task :android-pdf-viewer:packageDebugResources UP-TO-DATE
> Task :android-pdf-viewer:parseDebugLocalResources UP-TO-DATE
> Task :android-pdf-viewer:processDebugManifest UP-TO-DATE
> Task :android-pdf-viewer:generateDebugRFile UP-TO-DATE
> Task :android-pdf-viewer:extractDebugAnnotations UP-TO-DATE
> Task :android-pdf-viewer:extractDeepLinksForAarDebug UP-TO-DATE
> Task :android-pdf-viewer:javaPreCompileDebug UP-TO-DATE
> Task :android-pdf-viewer:compileDebugJavaWithJavac UP-TO-DATE
> Task :android-pdf-viewer:mergeDebugGeneratedProguardFiles UP-TO-DATE
> Task :android-pdf-viewer:mergeDebugConsumerProguardFiles UP-TO-DATE
> Task :android-pdf-viewer:mergeDebugShaders UP-TO-DATE
> Task :android-pdf-viewer:compileDebugShaders NO-SOURCE
> Task :android-pdf-viewer:generateDebugAssets UP-TO-DATE
> Task :android-pdf-viewer:packageDebugAssets UP-TO-DATE
> Task :android-pdf-viewer:prepareDebugArtProfile UP-TO-DATE
> Task :android-pdf-viewer:prepareLintJarForPublish UP-TO-DATE
> Task :android-pdf-viewer:processDebugJavaRes NO-SOURCE
> Task :android-pdf-viewer:mergeDebugJavaResource UP-TO-DATE
> Task :android-pdf-viewer:syncDebugLibJars UP-TO-DATE
> Task :android-pdf-viewer:writeDebugAarMetadata UP-TO-DATE
> Task :android-pdf-viewer:bundleDebugAar UP-TO-DATE
> Task :android-pdf-viewer:assembleDebug UP-TO-DATE
> Task :android-pdf-viewer:clean
./gradlew :android-pdf-viewer:clean :android-pdf-viewer:assembleDebug --info | grep "> Task"
> Task :android-pdf-viewer:clean
> Task :android-pdf-viewer:preBuild UP-TO-DATE
> Task :android-pdf-viewer:preDebugBuild UP-TO-DATE
> Task :android-pdf-viewer:mergeDebugJniLibFolders FROM-CACHE
> Task :android-pdf-viewer:mergeDebugNativeLibs NO-SOURCE
> Task :android-pdf-viewer:stripDebugDebugSymbols NO-SOURCE
> Task :android-pdf-viewer:copyDebugJniLibsProjectAndLocalJars
> Task :android-pdf-viewer:generateDebugResValues FROM-CACHE
> Task :android-pdf-viewer:generateDebugResources UP-TO-DATE
> Task :android-pdf-viewer:packageDebugResources FROM-CACHE
> Task :android-pdf-viewer:parseDebugLocalResources FROM-CACHE
> Task :android-pdf-viewer:processDebugManifest FROM-CACHE
> Task :android-pdf-viewer:generateDebugRFile FROM-CACHE
> Task :android-pdf-viewer:extractDebugAnnotations FROM-CACHE
> Task :android-pdf-viewer:extractDeepLinksForAarDebug UP-TO-DATE
> Task :android-pdf-viewer:javaPreCompileDebug FROM-CACHE
> Task :android-pdf-viewer:compileDebugJavaWithJavac FROM-CACHE
> Task :android-pdf-viewer:mergeDebugGeneratedProguardFiles UP-TO-DATE
> Task :android-pdf-viewer:mergeDebugConsumerProguardFiles UP-TO-DATE
> Task :android-pdf-viewer:mergeDebugShaders FROM-CACHE
> Task :android-pdf-viewer:compileDebugShaders NO-SOURCE
> Task :android-pdf-viewer:generateDebugAssets UP-TO-DATE
> Task :android-pdf-viewer:packageDebugAssets FROM-CACHE
> Task :android-pdf-viewer:prepareDebugArtProfile UP-TO-DATE
> Task :android-pdf-viewer:prepareLintJarForPublish UP-TO-DATE
> Task :android-pdf-viewer:processDebugJavaRes NO-SOURCE
> Task :android-pdf-viewer:writeDebugAarMetadata
> Task :android-pdf-viewer:mergeDebugJavaResource
> Task :android-pdf-viewer:syncDebugLibJars FROM-CACHE
> Task :android-pdf-viewer:bundleDebugAar
> Task :android-pdf-viewer:assembleDebug
ga...@google.com <ga...@google.com> #19
I was able to reproduce with
The part of task ordering that should not matter is about whether requested tasks are specified as ":foo:clean :foo:assemble :bar:clean :bar:assemble" or ":foo:clean :bar:clean :foo:assemble :bar:assemble". Obviously, if you run ":foo:assemble :foo:clean" that will 1st assemble :foo
and then delete its output. Hopefully that clarifies things.
ga...@google.com <ga...@google.com> #20
Actually not I can see in #13 that :mobile:assembleProdDebug
is before :mobile:clean
in the list, which is definitely off. I'm unable to repro that specific issue in NowInAndroid (clean
is always before assemble
task), but putting clean
tasks first in the list will address that issue as well.
to...@yahoo.com <to...@yahoo.com> #21
Looking again at
I was able to reproduce with https://github.com/android/nowinandroid and I have passed this information to Gradle.
can you please provide a link to the gradle issue you presumably opened ?
ga...@google.com <ga...@google.com> #22
there is a comment by a gradle engineer requesting to open a new issue but nothing else.
There is a new comment because I pinged them about this issue.
can you please provide a link to the gradle issue you presumably opened ?
I did not provide a link to the issue because I did not file one. It is always better if the filed issue comes directly from impacted users, so please do file one and comment on the existing Gradle issue with the link to a new one.
de...@google.com <de...@google.com> #24
FYI - studio-hedgehog-dev branch is ready for check ins, so feel free to cp!
ga...@google.com <ga...@google.com> #25
Merged in studio-hedgehog-dev as ag/I6b77300ed47ddebef55f06a433bebd654897aced.
to...@yahoo.com <to...@yahoo.com> #26
still a problem in Canary 16
ga...@google.com <ga...@google.com> #27
This will be fixed in H Beta1, note that H Canary 16 still has this issue.
to...@yahoo.com <to...@yahoo.com> #28
ah - thank you for letting us know
an...@gmail.com <an...@gmail.com> #29
Iguana Cannary 14 still has this issue
ga...@google.com <ga...@google.com> #30
Re #29: Can you please file a new issue with a sample project and steps to reproduce the bug?
an...@gmail.com <an...@gmail.com> #31
Created
Sorry for the late reply!
Description
Android studio hedgehog canary 11+. (on 10 version is fine) Gradle plugin version: 7.4.2 Build tools vesion: 33.0.2 Gradle version: 8.2 / 8.2.1 Os: Mac latest Java: 16.0.2 / 17.0.7 After upgrade from canary 10 in every build some projects i get issue: