https://kotlinlang.org logo
Title
m

morozov

09/25/2018, 12:00 PM
Who can help with implementation of
glide
? Right now i get next error in my logs:
Load failed for <https://upload.wikimedia.org/wikipedia/sco/7/71/Pringles.svg> with size [65x66]
         class com.bumptech.glide.load.engine.GlideException: Failed to load resource
:stackoverflow: 2
s

Sam

09/25/2018, 12:40 PM
@morozov Are you using androidsvg? https://github.com/BigBadaboom/androidsvg
m

morozov

09/25/2018, 12:43 PM
i used
implementation 'com.caverock:androidsvg:1.2.1'
also i tried to ask in so yesterday, but it doesn t help https://stackoverflow.com/questions/52481007/failed-to-load-svg-resource-on-android
s

Sam

09/25/2018, 12:51 PM
Try out 1.3 (implementation 'com.caverock:androidsvg-aar:1.3') and if it still fails, you might want to file a bug. The last time i tried, developer was responsive. http://bigbadaboom.github.io/androidsvg/
@morozov Seems to be working fine for me, tried with Glide 3.6.0 and androidsvg 1.2.1 https://github.com/Ethan1983/AndroidSVGGlideExample
FWIW, i didn't even need AppGlideModule and had to enable clear text http request ( Android Pie thing )
m

morozov

09/26/2018, 7:08 AM
for example, i created
<com.caverock.androidsvg.SVGImageView
            android:id="@+id/bankLogoView"
            style="@style/icon_account_view"
            app:svg="@drawable/ic_buy_violet"/>
also implement
implementation 'com.caverock:androidsvg-aar:1.3'
and after in my holder tried to use someting like
bankLogoView.setImageAsset(data.logoUrl)
or in holder i need to write smth else?
when i tried get svg image from asset like this:
bankLogoView.setImageAsset("wallet.svg")
all works correctly but if i try to get link from url:
val uri = Uri.parse("<https://upload.wikimedia.org/wikipedia/commons/3/35/Tux.svg>")
        bankLogoView.setImageURI(uri)
i get next error :
E/SVGImageView: File not found: <https://upload.wikimedia.org/wikipedia/commons/3/35/Tux.svg>
However, androidsvg1.2.1 fails for https://upload.wikimedia.org/wikipedia/commons/3/35/Tux.svg for API 28
Details at https://github.com/BigBadaboom/androidsvg/issues/148 but fix is available in 1.3
Tux download works on a lower API level though ( 26 etc )