Thread
#compose
    i

    Isaac Udy

    1 year ago
    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.
    Colton Idle

    Colton Idle

    1 year ago
    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)
    Adam Powell

    Adam Powell

    1 year ago
    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
    Piotr Prus

    Piotr Prus

    1 year ago
    Although, the original question is interesting and intrigue me as well. When the compose will be supported by stable AS?
    n

    nonameden

    1 year ago
    I think biggest problem not in AS itself. Compose required Canary AGP…
    Adam Powell

    Adam Powell

    1 year ago
    Nah, you can apply the compiler plugin and enable the IR backend manually and compose will be just as happy
    n

    nonameden

    1 year ago
    @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…
    > 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
    Colton Idle

    Colton Idle

    1 year ago
    @nonameden I think you have the wrong coordinates for the compiler Try using
    implementation 'androidx.compose.compiler:compiler:1.0.0-beta01'
    n

    nonameden

    1 year ago
    Could you please try before suggesting =)
    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
    so far using Jetbrains compose plugin with AndroidX Compose dependencies the only way to make it work on AGP stable...
    Tash

    Tash

    1 year ago
    @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

    1 year ago
    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
    Colton Idle

    Colton Idle

    1 year ago
    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

    1 year ago
    hm, you just need plugin and thats all, all dependencies are goes from androidx, so there are no conflicts…