https://kotlinlang.org logo
#compose
Title
# compose
i

Isaac Udy

03/02/2021, 12:15 AM
Does anyone know when Compose will be supported by a non-canary (beta or stable) version of Android Studio? The requirement to use the canary version makes it very difficult to adopt in a large project with multiple teams. It would be nice to be able to test it out in one module without forcing everyone to use AS canary.
c

Colton Idle

03/02/2021, 12:54 AM
I think you can include Compose in a project and still use stable/beta. You just won't get the preview support in the IDE. Apparently studio has a rule that no canary features ship in beta until they're deemed stable (something along those lines)
a

Adam Powell

03/02/2021, 3:10 AM
Or ide support for telling you when you're trying to call a composable function from an invalid spot, but generally yes. Nothing will stop you from using it with the stable ide version
p

Piotr Prus

03/02/2021, 6:42 AM
Although, the original question is interesting and intrigue me as well. When the compose will be supported by stable AS?
n

nonameden

03/05/2021, 3:22 AM
I think biggest problem not in AS itself. Compose required Canary AGP…
a

Adam Powell

03/05/2021, 3:37 AM
Nah, you can apply the compiler plugin and enable the IR backend manually and compose will be just as happy
n

nonameden

03/09/2021, 2:37 AM
@Adam Powell enabling IR not a problem, problem that Stable AGP can’t resolve
compose-compiler
it does not present in Google maven or central maven…
Copy code
> Could not resolve all files for configuration ':app:kotlin-extension'.
   > Could not find androidx.compose:compose-compiler:1.0.0-beta01.
     Searched in the following locations:
       - <https://dl.google.com/dl/android/maven2/androidx/compose/compose-compiler/1.0.0-beta01/compose-compiler-1.0.0-beta01.pom>
       - <https://jcenter.bintray.com/androidx/compose/compose-compiler/1.0.0-beta01/compose-compiler-1.0.0-beta01.pom>
     Required by:
         project :app
Changing AGP to Canary version solves the problem
c

Colton Idle

03/09/2021, 3:10 AM
@nonameden I think you have the wrong coordinates for the compiler Try using
implementation 'androidx.compose.compiler:compiler:1.0.0-beta01'
n

nonameden

03/09/2021, 3:33 AM
Could you please try before suggesting =)
Copy code
Try using implementation 'androidx.compose.compiler:compiler:1.0.0-beta01'
your statement does not contain
coordinates
as well, it still will look into jcenter and google maven repo
😂 1
so far using Jetbrains compose plugin with AndroidX Compose dependencies the only way to make it work on AGP stable...
t

Tash

03/17/2021, 1:52 AM
@nonameden Came across your last message ^. Interested in understanding how you were able to make it work on AGP stable. May I ask what your setup looks like, which AGP stable version you tried with, etc? Thank you! 🙏🏼
n

nonameden

04/11/2021, 11:01 PM
Here Jetbrain Compose Github: https://github.com/jetbrains/compose-jb they have samples for Android, jsut copy setup in gradle and use dependencies in your module from androidx compose, works great no issues, only preview of composables does not exist in stable but everything else works nice and smooth
🙏🏼 1
c

Colton Idle

04/11/2021, 11:03 PM
It is more difficult to adopt compose desktop into an existing Android compose project though. The version numbers all end up conflicting (i.e. Gradle and agp)
n

nonameden

04/19/2021, 11:13 PM
hm, you just need plugin and thats all, all dependencies are goes from androidx, so there are no conflicts…
2 Views