Trying to add 1.0.8 to an existing project, kotlin...
# compose
m
Trying to add 1.0.8 to an existing project, kotlin 1.4.20
Copy code
composeOptions {
    kotlinCompilerVersion '1.4.20'
    kotlinCompilerExtensionVersion '1.0.0-alpha08'
}
kotlinOptions {
    useIR = true
    jvmTarget = "1.8"
}
Everything works until I add buildFeatures { compose true } When compose is enabled the project never finishes building. I have multiple attempts, and my last one has been running for 3 hours 36 minutes ๐Ÿ˜• Any ideas what might be wrong?
j
That sounds like maybe we have an infinite loop or something in the Compose Compiler. You could try doing a
kill -3
to see what is on the stack. Or better yet, can you try to create a minimal repro and post it to github so we can investigate?
m
Could you explain what you mean by doing a
kill -3
? ๐Ÿ˜…
j
Maybe you are using something that uses kapt or kotlin Serialization?
m
yeah there are still synthetics in the project. I thought with 1.4.20 and 1.0.8 you could use both blob thinking upside down
j
kill -3
is an easy way to send a SIGQUIT to a running java process, which will result in the process dumping the jvm state including all thread stacks (https://www.baeldung.com/java-thread-dump#1-kill--3-command-linuxunix). But it's not the only way to get stack traces (as per other options in that same link). It would provide a hint as to what's going on, but it's not guaranteed to give us a useful answer, so if you aren't familiar with capturing JVM stacks, probably a minimal repro would be the best way to ensure we're able to reproduce and fix the issue.
๐Ÿ™Œ 1
m
i also struggled with that problem. Did you find the solution?
Btw, any change you also using viewBinding in the same project? If so, i got the solution for you ๐Ÿ˜›
actually, for me was serialization i think, not viewbinding
for me it was a conflict between kotlin-parcelize and compose in the same module. moved kotlin-parcelize to a separate module which fixed the problem
m
I have exactly the same issue. I tried adding compose to existing project and it ends up being stuck at
> Task :app:compileDevDebugKotlin
My project is quite complex so for me it's hard to distil what the problem is. I'm currently in the process of migrating kotlin-synthetics to viewbinding so it might be related
m
I finally caved, spent most of saturday replacing all of the synthetics with viewbinding ๐Ÿ˜… Now it works ๐Ÿ™‚
m
Oh so was that the issue? Maybe I should bite the bullet and do it as well ๐Ÿ™‚
m
I think so, yeah!
j
@Mantas Varnagiris kapt in the same module will give you problems too (if you are using room for example)
or kotlin serializarion
m
I have kapt, but it's for Hilt. So that also might be an issue
j
you can check the samples where they use hilt to see a way to create the module structure to get it working
๐Ÿ‘ 1