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

Christian

10/09/2020, 4:00 AM
Hi, anybody encountered this problem when upgrading to alpha04
Cannot import 'weight', functions and properties can be imported only from packages or objects
on Jetpack-Compose-Playground-master project?
s

Sam

10/09/2020, 6:00 AM
Yes, for
alpha04
you may need to import:
Copy code
import androidx.compose.foundation.layout.ColumnScope.Companion.weight
👍 2
v

Vince Rickey

10/30/2020, 9:26 PM
Thank you Sam! I recently migrated from a Dev to Alpha version of Jetpack Compose and this was one of the last snags. I also needed to add a manual import in order for Modifer.weight to work properly. For anyone out there in the future, in my case the error I got was
Expression 'weight' cannot be invoked as a function. The function 'invoke()' is not found
2 Views