Reputation: 1457
I have created new Android Application with this settings in build.gradle
android {
compileSdkVersion 'android-S'
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.aviftest"
minSdkVersion 16
targetSdkVersion "S"
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
}
I have added Glide Library for Image Loading in ImageView. Code for Loading Image in ImageView is
val url:String="https://petapixel.com/assets/uploads/2021/02/f1-good-a14c8cc5.avif"
Glide.with(this).load(url).centerCrop()
.placeholder(R.mipmap.ic_launcher)
.into(myImage);
The error showing in Log says
W/Glide: Load failed for https://petapixel.com/assets/uploads/2021/02/f1-good-a14c8cc5.avif with size [198x198]
class com.bumptech.glide.load.engine.GlideException: Failed to load resource
There was 1 root cause:
com.bumptech.glide.load.HttpException(Failed to connect or obtain data, status code: -1)
call GlideException#logRootCauses(String) for more detail
After installing app the Avif Image is not loading from source. What can be the cause for this ?
Upvotes: 1
Views: 2170
Reputation: 14135
Glide added AVIF support in 4.13.0 and made it work 4.13.1.
Next to updating glide, include the AVIF integration:
implementation "com.github.bumptech.glide:avif-integration:$glide_version"
Upvotes: 1