domeneck
domeneck

Reputation: 83

Android Jetpack Compose - R.drawable not found?

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

Answers (2)

Karan M
Karan M

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

Morteza Allahyari
Morteza Allahyari

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

Related Questions