Skip to content Skip to sidebar Skip to footer

Unresolved Reference: Drawimage

I'm trying call DrawImage() on my code, I'm following this tutorial Jetpack Tutorial, But I'm getting this error.: Unresolved reference: DrawImage I tried implement on build.grad

Solution 1:

In your module's build.gradle file, make sure that you have this in your android closure:

  buildFeatures {
    compose true
  }

  composeOptions {
    kotlinCompilerVersion "1.3.61-dev-withExperimentalGoogleExtensions-20200129"
    kotlinCompilerExtensionVersion "0.1.0-dev04"
  }

My guess is that you are missing the composeOptions.

Solution 2:

DrawImage() is part of androidx.ui:ui-foundation.

Open the build.gradle (Module: app) file and add the following line to the list of dependencies:

dependencies {
    ...
    implementation 'androidx.ui:ui-foundation:0.1.0-dev03'
}

I would recommend following Jetpack Compose Basics - Codelab, a more comprehensive tutorial by Google.

Solution 3:

You can see the latest composeOptions for the correct build here.

But keep in mind that the library API can vary greatly from version to version, and it would be better to take a look at the official example to examine the use of the Compose library.

Don't forget to switch the repository to the right branch corresponding to the latest version of the library (for example, at the time of the answer it's dev05 branch).

Post a Comment for "Unresolved Reference: Drawimage"