Android preview as below in Fleet - AGP `8.6.1` - ...
# fleet
d
Android preview as below in Fleet - AGP
8.6.1
- any common causes? Android Preview worked once and never since! Cleaned project, still the same.
g
maybe the composables are using stringResources? I had issues where they would not render if some library versions did not match
try using Compose Multiplatform 1.7+ and AGP 8.5.2+
w
I have encountered this problem many times.
šŸ‘€ 1
d
...did you find a solution, or are we both suffering? šŸ˜…
a
You have cursed me - I didn’t have a problem until I read this thread
šŸŽŽ 3
OK, so I seem to have a fix - revert to
compose-plugin = "1.7.0-alpha01"
(in libs.versions.toml) I’ve been back and forth trying this out and neither
1.7.0-rc01
nor
1.7.0
work with Android previews in Fleet. Note that you also need to do an Android build after changing this version. It seems to work OK if just build and run in Fleet but I’ve found things more robust if I run Android Studio and do a Clean then Run in there.
blob ty sign 1
d
Awesome - thanks @Andy Dent
a
Note that this could just be some conjunction of weird settings/configs that magically worked but have spent at least a couple of hours going back and forth testing with my PreviewablePic sample aaand trying a different (local) sample it seems quite happy with 1.7.0-rc01, am still testing. This may be very sensitive to mixes of other versions of things
hah! yes it is - now working with release 1.7.0 Compose - libs.versions.toml - agp 8.2.2 => 8.6.1 - androidx-activityCompose 1.9.2 => 1.9.3 - androidx-lifecycle 2.8.2 => 2.8.3 - kotlin 2.0.20 => 2.0.21 - compose-plutin 1.7.0-alpha01 => 1.7.0 - gradle-wrapper.properties - distributionUrl bumped from 8.6 to 8.7
Bottom line is - do not ignore the yellow underlines in libs.versions.toml
kodee happy 1
To be fair, I hadn’t read the ā€œwhat’s newā€ https://www.jetbrains.com/help/kotlin-multiplatform-dev/whats-new-compose-170.html which very clearly states
Android Studio previews are available only for composables in Android source sets. They also require one of the latest versions of AGP: 8.5.2, 8.6.0-rc01, or 8.7.0-alpha04.
So the big fix in my list of changes above is probably the agp bump up from 8.2.2 (the gotcha being that it worked fine with 1.7.0-alpha01)
šŸ‘Œ 1
d
You know what could be a really great use for AI? A 'version wizard' with access to the release notes of major ecosystem libraries. AI particularly suitable for this since the right version bracket to sit at, at any given stage of development, isn't always black & white - it could help you negotiate features vs. migration costs vs. feasibility/compatibility. šŸ¤”
I tried setting my AGP to
8.7.0-alpha04
but Fleet just ignores it, always saying
8.7.0
is incompatible. I may just have to give up on Preview for now and revert to running the App, it's slow but this is slower. What a waste of time.
a
Android preview as below in Fleet - AGP
8.6.1
- any common causes? Android Preview worked once and never since!
sorry hadn’t noticed in your earlier post that point. OK, so it’s not just that I updated to AGP 8.6.1 that fixed things. It’s something about the combination of stuff (he says hopefully)
d
I've admitted defeat and rolled back to Android-only previews here @Andy Dent blob upside down