Status Update
Comments
mg...@google.com <mg...@google.com> #2
I've submitted a fix for this, which should (I hope) make it into Jellyfish Canary 12. There's a relatively straightforward workaround, which is to explicitly declare the version of the com.android.tools.build:gradle
artifact in all build files -- in the screenshot, your project has a versioned classpath
dependency, but also an unversioned one, and it's that unversioned one that tripped up the AGP Upgrade Assistant. Since there is that workaround of making sure that all the classpath dependencies on com.android.tools.build:gradle
have an explicit version, we probably won't patch this for Iguana, I'm afraid.
Thanks very much for the report!
ap...@google.com <ap...@google.com> #3
Thank you for your patience while our engineering team worked to resolve this issue. A fix for this issue is now available in:
- Android Studio Jellyfish | 2023.3.1 Canary 12
- Android Gradle Plugin 8.4.0-alpha12
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Thank you for taking the time to submit feedback — we really appreciate it!
Description
saveable
has built-in support for Coroutines'MutableStateFlow
, supporting the following use case:It does this by providing an overloaded function that handles
MutableStateFlow.value
and serializes it when needed.To help people migrate from
saveable
tosaved
, we want to supportMutableStateFlow
in our KotlinX serialization support.While working on getMutableStateFlow CL, I experimented with this idea and created a naive
KSerializer
implementation to handleMutableStateFlow
.Here’s what it could look like:
For serialization, we would use
(value as MutableStateFlow<T>).value
+valueSerializer
to serialize the content. Deserialization works in the opposite direction.Here’s a usage example:
However, calling this without the serializer would cause an exception.
Our variant should work like
saveable
: ifT
(the generic type insaved
) is serializable, it should work without needing the serializer.The goal is to find the best way to support
MutableStateFlow
insaved
.Related to b/378895074 .