Hi everyone! Has anyone managed to successfully in...
# compose
p
Hi everyone! Has anyone managed to successfully integrate compose to a production app that still builds with AGP 4.1? I've heard of this trick, and was wondering if anyone had this setup in their project.
j
Yes, using that setup here for app that's in play store. It works but of course you miss out on compose related tooling that's in Canary version
p
Great to hear 👍 Yes of course we wouldn't get all the tooling. But that'd still be a good compromise since we aren't ready yet to use a non stable AGP for our app.
c
Yeah. We're using the "trick". I think we use agp 4.2+ though. Just not 7.
p
Makes sense. We're still on AGP 4.1 because some of our dependencies are still preventing us from bumping... So I gave this a try, by adding what's on the article to one of our module's gradle file. I managed to compile the code, although I'm now getting a runtime crash:
Copy code
java.lang.NoSuchMethodError: No static method setContent$default(Landroidx/activity/ComponentActivity;Landroidx/compose/runtime/CompositionContext;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)V in class Landroidx/activity/compose/ComponentActivityKt...
I just added a very simple composable function to one of our activity, that just displays some text. Have you folks ever run into that issue?
setContent()
is coming from
activity-compose
dependency if I'm not wrong. I added this one:
Copy code
// Integration with activities
implementation 'androidx.activity:activity-compose:1.3.0-alpha03'
i
p
☝️Ok so I bumped to
1.3.0-alpha07
and I'm still getting the exact same crash.