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

nschulzke

12/15/2021, 10:47 PM
I'm getting a compiler plugin error while building an android project with Kotlin 1.6, Jetpack Compose 1.1.0-rc01. Does anyone know how to debug these kinds of compiler plugin errors, or have an idea what this one means?
Copy code
java.lang.IllegalStateException: Symbol for kotlin.collections/mutableMapOf|-4813910536206556932[0] is unbound
	at org.jetbrains.kotlin.ir.symbols.impl.IrBindablePublicSymbolBase.getOwner(IrPublicSymbolBase.kt:52)
	at org.jetbrains.kotlin.ir.symbols.impl.IrSimpleFunctionPublicSymbolImpl.getOwner(IrPublicSymbolBase.kt:74)
	at androidx.compose.compiler.plugins.kotlin.lower.LiveLiteralTransformer.visitCall(LiveLiteralTransformer.kt:663)

...
It looks like this should be solvable by disabling liveLiterals, but I can't figure out how to do that.
Copy code
freeCompilerArgs += ['-P', 'plugin:androidx.compose.compiler.plugins.kotlin:liveLiterals=false']
freeCompilerArgs += ['-P', 'plugin:androidx.compose.compiler.plugins.kotlin:liveLiteralsEnabled=false']
When I use this, I get this error:
Copy code
Multiple values are not allowed for plugin option androidx.compose.compiler.plugins.kotlin:liveLiterals
I fixed it by simplifying some code that looked like this:
Copy code
val x = mutableMapOf("something" to "something").apply {
    if (bool) {
        put("another", "thing")
    }
}
To this:
Copy code
val x = mutableMapOf()
x["something"] = "something"
if (bool) {
    x["another"] = "thing"
}
b

Bradleycorn

12/20/2021, 5:37 PM
I’ve disabled live editing of literals (done in the AS preferences), and I updated the one and only instance of
mutableMap
that was written like @nschulzke mentioned above … I still get this issue.
335 Views