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

henrikhorbovyi

07/25/2020, 5:24 AM
Is it possible to use Compose with a non androidx project. I mean, I'm contributing to a project (Koin to be specific) and I'd like to add a module running compose to add some feature to the whole project, but compose complains that my project is not androidx I should add:
Copy code
android.useAndroidX=true
android.enableJetifier=true
To the gradle.properties, but it would impact imports in the entire project 😞 I've tried to add a gradle.properties for the specific module, but it didn't work
g

gildor

07/25/2020, 5:52 AM
It’s really time to migrate to androidx
👍 7
But what is exact problem with koin? there are modules there which use androidx dependencies with no problems
adding to gradle.properties of the module should be enough
i

itnoles

07/25/2020, 6:18 AM
old android.support.* is DEAD and Buried!!!
👍 3
g

gildor

07/25/2020, 9:36 AM
I also think that android.enableJetifier should be false by default, to force everyone to check that none of dependencies use android.support, which itself a big red flag
1
t

Timo Drick

07/25/2020, 10:55 AM
You should consider migrating the whole project to androidx. (In my experience most of the time it is done in 1 day) Maybe when it is very complex it takes more time.
h

henrikhorbovyi

07/25/2020, 5:23 PM
But I don't want to submit 1k changes 😄 Just because my feature witch is one function
@gildor there are modules that uses androidx in Koin by declaring:
Copy code
android.useAndroidX=true
android.enableJetifier=true
on a local gradle.properties, I've tried to do the same with my module, but as compose complains about it, and it say that the whole project must be androidx
Look, there is a local gradle.properties for the module that uses androidx
I did the same for my module, but it complains
Copy code
This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry.