简体   繁体   English

Android,无法解析ImageDecoder

[英]Android , cannot resolve ImageDecoder

I am trying to use ImageDecoder in my Android app and the IDE says it cannot resolve it. 我正在尝试在Android应用程序中使用ImageDecoder ,IDE表示无法解决它。 Should i add any library for this to be resolved? 我应该添加任何库来解决此问题吗? My compileSdkVersion is 27 , which seems to be the latest. 我的compileSdkVersion是27,这似乎是最新的。

public final class ImageDecoder extends Object implements AutoCloseable 公共最终类ImageDecoder扩展对象实现AutoCloseable

A class for converting encoded images (like PNG, JPEG, WEBP, GIF, or HEIF) into Drawable or Bitmap objects. 用于将编码的图像(如PNG,JPEG,WEBP,GIF或HEIF)转换为Drawable或Bitmap对象的类。

  • API Level required P or Higher . API级别要求P or Higher

You should set compileSdkVersion 'android-P' 您应该设置compileSdkVersion 'android-P'

android {
compileSdkVersion 'android-P'

defaultConfig {
    targetSdkVersion 'P'
}

Set Up the Android P SDK

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM