I wanted to migrate my existing project to partially use Jetpack compose for it.
So I opened it using Android studio 4.2-canary9 and added
I had a similar problem when I was migrating a template project. What fixed it for me was deleting some template code that accessed elements that were grabbed by findbyviewid.
Apparently, this issue has been fixed and will be shipped to Kotlin:1.4.20
(Which is not released at the time)
Google issue tracker reference
Kotlin Pull request
[Update at 27 Nov]
Updating to 1.4.20
leads to another error [Ref]
I had the same problem. As a workaround, I replaced all Kotlin synthetic with ViewBinding. After I did it everything worked.