Unresolved reference: DrawImage

后端 未结 3 1185
半阙折子戏
半阙折子戏 2020-12-21 12:09

I\'m trying call DrawImage() on my code, I\'m following this tutorial Jetpack Tutorial,

But I\'m getting this error.:

Unresolved reference: Dr

相关标签:
3条回答
  • 2020-12-21 12:49

    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).

    0 讨论(0)
  • 2020-12-21 12:53

    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.

    0 讨论(0)
  • 2020-12-21 13:11

    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.

    0 讨论(0)
提交回复
热议问题