Reputation: 83
I recently started learning Jetpack Compose. Here is problem. When i try to create image android studio can't find R.drawable folder. It looks like that. 1 Why is that?
@Edit: Thank You! Importing R helped.
Upvotes: 8
Views: 4406
Reputation: 51
Imports in Compose are super important. A small piece like dp or sp can also loose context without specific imports like import androidx.compose.ui.unit.dp, or import androidx.compose.ui.unit.sp
Upvotes: 0
Reputation: 1110
Be careful that R is imported correctly.
import [BASE_PACKAGE_NAME].R
and check is painterResource imported correctly?
import androidx.compose.ui.res.painterResource
Upvotes: 19