Status Update
Unfortunately the issue in Studio 2024.2.2 Canary 9 was destructive and removed information from the stored run configurations, even when just opening and closing the project.
We explored if this could be detected and automatically fixed, but unfortunately the end result is not unambiguously distinguishable from a manually edited run configuration and we didn't want to run the risk of any mitigation breaking things further or causing more confusion.
If you have a project with this issue, you can either
- delete the broken run configuration, and manually recreate it in the UI or
- delete it from the file system, which will trigger the automatic creation of the app run configurations that happen on first import.
- if you're using git with the default
.gitignore
closing the project, runninggit clean -fdx
- closing the project, removing all of the .idea folder
- if you're using git with the default
Comments
pu...@gmail.com <pu...@gmail.com> #2
Maybe a dup of
to...@yahoo.com <to...@yahoo.com> #3
Android Gradle Plugin: 8.7.1
Could you try the latest canary, AGP 8.8.0-alpha09
?
ze...@gmail.com <ze...@gmail.com> #4
I just updated to Android Gradle Plugin: 8.7.2 and the bug is fixed.
je...@google.com <je...@google.com>
st...@gmail.com <st...@gmail.com> #5
I spoke too soon. The bug appears gone when I use a different computer, but that is only because the lint check is disabled on it. The computer with the false positive is a new cloning of my github project which apparently has the lint check enabled. The AGP 8.8.0-alpha09 plugin will not work on ladybug, and I'm too busy to switch to a canary build of android studio just to fix a false positive lint check, sorry.
pa...@gmail.com <pa...@gmail.com> #6
I just tried running lint on two more of my computers, one which also has a fresh clone of the github project, and one which has an "ancient" (but up to date) clone of the project -- the two computers have very different Settings -> Editor -> Inspections choices. The old clones do not have this lint check anywhere in their choices, whereas new clones do. Very odd indeed. (I have .idea/ in my .gitignore BTW).
ka...@google.com <ka...@google.com> #7
I understand that it's not trivial to change AGP version; sorry for suggesting that first.
Actually, there is a better way to test: android.experimental.lint.version=8.8.0-alpha09
which will just change the Lint version.
vm...@google.com <vm...@google.com>
r....@gmail.com <r....@gmail.com> #8
I decided it was easier to download Android Studio Ladybug Feature Drop | 2024.2.2 Canary 9 than to figure out how to use a different version of lint (a search of stackoverflow suggests this is impossible for what that is worth). Using AGP 8.8.0-alpha09 and gradle-8.10.2-bin.zip on Canary the same error occurs. It looks like it is caused by the K2 compiler mode, because the Inspections options for this lint check does not appear until you enble K2 mode (nor does the false positive error).
ka...@google.com <ka...@google.com> #9
Thank you for trying the latest canary version of Studio and AGP, I really appreciate that.
I rather confirmed that, with that canary (AGP 8.8.0-alpha09),
I also tried altering problematic produceState
call with conditional assignment to value
, which also works fine. I tried a similar code pattern on compose runtime ProduceStateDetector
and its tests, but no luck.
Then... my next guess is whether it is from an old compose runtime, assuming this might be a dup of
ni...@gmail.com <ni...@gmail.com> #10
The compose runtime is from the androidx-compose-bom = "2024.10.01", which is 1.7.5, which is the latest stable version according to its webpage. The project uses libs.versions.toml and gradle assures me that all the versions are up to date (for what that is worth - sometimes I have to manually update versions). I enclose the libs.versions.toml the project uses. The project is my copy of the "Crane" sample app which I have verbosely commented and try to keep up to date with the latest libraries and APIs. The source code involved is in my github repo in the Crane project:
The file the false positive is in is:
Crane/app/src/main/java/androidx/compose/samples/crane/details/DetailsActivity.kt
ka...@google.com <ka...@google.com> #11
Thank you again for sharing all the details!
With the repo, I can reproduce the issue:
$ ./gradlew lint
> Task :app:lintDebug FAILED
Lint found 1 errors, 8 warnings. First failure:
.../Composables/Crane/app/src/main/java/androidx/compose/samples/crane/details/DetailsActivity.kt:243: Error: produceState calls should assign value inside the producer lambda [ProduceStateDoesNotAssignValue from androidx.compose.runtime]
val uiState: DetailsScreenUiState by produceState(
~~~~~~~~~~~~
Explanation for issues of type "ProduceStateDoesNotAssignValue":
produceState returns an observable State using values assigned inside the
producer lambda. If the lambda never assigns (i.e value = foo), then the
State will never change. Make sure to assign a value when the source you
are producing values from changes / emits a new value. For sample usage see
the produceState documentation.
Vendor: Jetpack Compose
Identifier: androidx.compose.runtime
Feedback: https://issuetracker.google.com/issues/new?component=612128
...
FAILURE: Build failed with an exception.
...
which is a build error in CLI. That is indeed a dup of
$ git diff
diff --git a/Crane/gradle/libs.versions.toml b/Crane/gradle/libs.versions.toml
index c3b2e3ca..c488d929 100644
--- a/Crane/gradle/libs.versions.toml
+++ b/Crane/gradle/libs.versions.toml
@@ -4,7 +4,7 @@
#####
[versions]
accompanist = "0.34.0"
-androidGradlePlugin = "8.7.2"
+androidGradlePlugin = "8.8.0-alpha09"
androidx-activity-compose = "1.9.3"
androidx-appcompat = "1.7.0"
androidx-benchmark = "1.3.3"
diff --git a/Crane/gradle/wrapper/gradle-wrapper.properties b/Crane/gradle/wrapper/gradle-wrapper.properties
index 1918a64e..9c74e424 100644
--- a/Crane/gradle/wrapper/gradle-wrapper.properties
+++ b/Crane/gradle/wrapper/gradle-wrapper.properties
@@ -14,6 +14,6 @@
#Sat Nov 2 07:49:36 AM EDT 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
$ ./gradlew lint
...
BUILD SUCCESSFUL in 1m 51s
31 actionable tasks: 30 executed, 1 from cache
build went well.
However, K2 UAST's IDE path still has an issue on binary resolution for @Composable
. :( That part is a dup of
ka...@google.com <ka...@google.com> #13
Aha! I see the problem. I always use the "Problems" tool window of the IDE to run lint. When I use "./gradlew lint" I get the same results as you do. Apparently the IDE is running lint wrong, feeding lint mangled code, misinterpreting lint's results, or using cached values from AGP 8.7.2 instead of using 8.8.0-alpha09 values. (But these are just guesses of course.)
jo...@google.com <jo...@google.com>
ka...@google.com <ka...@google.com>
ka...@google.com <ka...@google.com> #14
Apparently the IDE is running lint wrong, feeding lint mangled code, misinterpreting lint's results, or using cached values
The issue is the Kotlin compiler front end; when lint within AGP, we have to bundle and invoke our own copy of the Kotlin compiler front end. But when we run inside the IDE, we directly reuse the one from the Kotlin plugin; that way we don't have to re-analyze your code etc, so it's more performant. But that means that lint running in the IDE and lint running from AGP use potentially different versions of the front end.
an...@google.com <an...@google.com> #15
hobby. Let me know if I can be of any help.
On Tue, Nov 5, 2024 at 10:51 AM <buganizer-system@google.com> wrote:
fl...@gmail.com <fl...@gmail.com> #16
Since CLI-side fix is already there, it's relatively easy(?) to port that to IDE-side, and actually ready; see attached screenshot.
fl...@gmail.com <fl...@gmail.com> #17
Pressing the play button doesn't even compile anymore... Like you can have non compilable code and see a deployment working successfully...
ka...@google.com <ka...@google.com> #18
Can you please elaborate on what do you mean by this is the same issueand confirm if this is happenin on a projec you previously opened with Canary 9 ?
fl...@gmail.com <fl...@gmail.com> #19
I tried with Android Studio Meerkat | 2024.3.1 Canary 1 and it also doesn't compile the project when you click on the play button. It only deploy to your device the previously compiled version, there is no written error but that's an error to me.
Like if you do a ./gradlew clean then click on the play button won't do anything as it won't be able to rebuild an apk to deploy.
ka...@google.com <ka...@google.com> #20
This is adifferent bug from what you are experiencing. Please file a bug and the team will take care of it. Thank you.
fl...@gmail.com <fl...@gmail.com> #21
ok I have created a new ticket there
en...@gmail.com <en...@gmail.com> #22
ka...@google.com <ka...@google.com> #23
Please refer to
cm...@google.com <cm...@google.com> #24
For context, unfortunately the issue in Studio 2024.2.2 Canary 9 was destructive and removed information from the stored run configurations, just from opening and closing the project.
We explored if this could be detected and automatically fixed, but unfortunately the end result is not unambiguously distinguishable from a manually edited run configuration and we didn't want to run the risk of any mitigation breaking things further or causing more confusion.
Other workarounds include
- deleting the broken run configuration, and manually recreating it in the UI
- if you're using git with the default
.gitignore
closing the project, runninggit clean -fdx
and reopening will remove all previous run configurations and trigger the automatic creation of the app run configurations that happen on first import. - closing the project, removing all of the .idea folder (that might contain some shared settings though) and reopen the project will trigger the automatic creation of the app run configurations
an...@google.com <an...@google.com> #25
The fixes for this issue are now also available in:
- Android Studio Ladybug Feature Drop | 2024.2.2 Beta 1
- Android Gradle Plugin 8.8.0-beta01
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
lb...@gmail.com <lb...@gmail.com> #26
@25 I have the next canary and it's still not fixed. How come?
Android Studio Meerkat | 2024.3.1 Canary 3
Build #AI-243.21565.193.2431.12691553, built on November 21, 2024
Runtime version: 21.0.5+-12651406-b631.16 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.windows.WToolkit
Windows 11.0
Kotlin plugin: K2 mode
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 6144M
Cores: 16
Registry:
ide.instant.shutdown=false
ide.experimental.ui=true
i18n.locale=
ide.images.show.chessboard=true
Non-Bundled Plugins:
com.intellij.marketplace (243.21565.247)
cn.jxzhang.plugin.json-formatter (1.6)
Show As ... (1.0.3)
String Manipulation (9.14.1)
GenerateSerialVersionUID (3.0.3)
com.steve.plugins.autoscroll (1.1)
com.dethlex.numberconverter (2.1.1)
izhangzhihao.rainbow.brackets (2024.2.7-241)
com.developerphil.adbidea (1.6.19)
GenerateSerializationHelpers (1.0.6)
cn.yiiguxing.plugin.translate (3.6.7)
ko...@gmail.com <ko...@gmail.com> #27
If you've already opened a project with Ladybug Canary 9, you have to manually fix the problem. There's the solution and explanation in #14 and #24.
lb...@gmail.com <lb...@gmail.com> #28
@27 OK thanks.
cr...@gmail.com <cr...@gmail.com> #29
From
on 1/11/2024: issue 376707224
Probably duplicate of
an...@google.com <an...@google.com> #30
The fixes for this issue are now also available in:
- Android Studio Meerkat Feature Drop | 2024.3.2 Canary 3
- Android Gradle Plugin 8.10.0-alpha03
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
an...@google.com <an...@google.com> #31
Further fixes for this issue are now available in:
- Android Studio Meerkat | 2024.3.1 RC 1
- Android Gradle Plugin 8.9.0-rc01
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
an...@google.com <an...@google.com> #32
Further fixes for this issue are now available in:
- Android Studio Meerkat Feature Drop | 2024.3.2 Canary 4
- Android Gradle Plugin 8.10.0-alpha04
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
an...@google.com <an...@google.com> #33
Further fixes for this issue are now available in:
- Android Studio Ladybug Feature Drop | 2024.2.2 Patch 1
- Android Gradle Plugin 8.8.1
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
an...@google.com <an...@google.com> #34
Further fixes for this issue are now available in:
- Android Studio Meerkat | 2024.3.1 RC 2
- Android Gradle Plugin 8.9.0-rc02
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
dm...@gmail.com <dm...@gmail.com> #35
Build #AI-243.22562.218.2431.13114758, built on February 25, 2025
Runtime version: 21.0.5+-12932927-b750.29 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Error loading build artifacts from:
../app/build/intermediates/apk_ide_redirect_file/productionDebug/createProductionDebugApkListingFileRedirect/redirect.txt
How to reproduce:
* Build -> Clean project
* Run -> Run 'app'
Invalidate caches doesn't help
Description
After upgrading from Ladybug Canary 8 to Canary 9, running my app (Shift+F10) does not automatically builds it anymore (if needed) first, which results in this error:
To be able to run it, I have to manually build it first (CTRL+F9). And this, each time I make a modification to the code.
Studio Build: Build #AI-242.23339.11.2422.12584204, built on October 31, 2024 Version of Gradle Plugin: 8.8.0-alpha09 Version of Gradle: 8.10.2 Version of Java: OS: Linux