1

I am using following implementation of coil for loading svg image

// in gradle build
implementation 'io.coil-kt:coil-svg:1.4.0'

with extension function to load svg as

fun ImageView.loadUrl(url: String) {

val imageLoader = ImageLoader.Builder(this.context)
    .componentRegistry { add(SvgDecoder(this@loadUrl.context)) }
    .build()

val request = ImageRequest.Builder(this.context)
    .crossfade(true)
    .crossfade(500)
    .data(url)
    .target(this)
    .build()

imageLoader.enqueue(request)
}

loading image in coroutine scope as

  account.addressQrcode?.let { qrCodeAddress ->

        img_qrCode.loadUrl(qrCodeAddress)
        qrItemLoader.isVisible = false
 }

which is perfectly working with proguard off, but after turning my proguard on as

 buildTypes {
    release {
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
    debug {
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}

coil is not able to load image, i have read there documentation they say that they dont need any explicitly proguard rules. which they need for coroutines, okhttp and okio i have already included that in mine.

let me know if i am missing something here...

Manzoor Ahmad
  • 481
  • 6
  • 21

0 Answers0