使用Glide

时间:2019-06-18 10:14:13

标签: android svg kotlin android-glide

我正在使用最新的滑行库和'jp.wasabeef:glide-transformations'库来处理圆角:

implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
implementation 'jp.wasabeef:glide-transformations:4.0.1'

我从url加载图像,如下所示:

 Glide.with(context)
            .load(uri)
            .transform(RoundedCornersTransformation(
                        radius, 0,
                        RoundedCornersTransformation.CornerType.RIGHT
                    ))

一切正常,但是如果我尝试加载.svg glide会抛出异常:

  

I / Glide:根本原因(2之1)       java.io.IOException:java.lang.RuntimeException:setDataSource失败:status = 0x80000000           在com.bumptech.glide.load.resource.bitmap.VideoDecoder.decode(VideoDecoder.java:173)           在com.bumptech.glide.load.engine.DecodePath.decodeResourceWithList(DecodePath.java:72)           在com.bumptech.glide.load.engine.DecodePath.decodeResource(DecodePath.java:55)           在com.bumptech.glide.load.engine.DecodePath.decode(DecodePath.java:45)           在com.bumptech.glide.load.engine.LoadPath.loadWithExceptionList(LoadPath.java:58)           在com.bumptech.glide.load.engine.LoadPath.load(LoadPath.java:43)           在com.bumptech.glide.load.engine.DecodeJob.runLoadPath(DecodeJob.java:515)           在com.bumptech.glide.load.engine.DecodeJob.decodeFromFetcher(DecodeJob.java:480)           在com.bumptech.glide.load.engine.DecodeJob.decodeFromData(DecodeJob.java:466)           在com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:418)           在com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:387)           在com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:95)           在com.bumptech.glide.load.model.FileLoader $ FileFetcher.loadData(FileLoader.java:76)           在com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:75)           在com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:309)           在com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:426)           在com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:387)           在com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:95)           在com.bumptech.glide.load.model.FileLoader $ FileFetcher.loadData(FileLoader.java:76)           在com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:75)           在com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:309)           在com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:426)           在com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:387)           在com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:95)           在com.bumptech.glide.load.model.ByteBufferFileLoader $ ByteBufferFetcher.loadData(ByteBufferFileLoader.java:74)           在com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:75)           在com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:309)           在com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:276)           在com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:235)           在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)           在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:641)           在java.lang.Thread.run(Thread.java:784)           在com.bumptech.glide.load.engine.executor.GlideExecutor $ DefaultThreadFactory $ 1.run(GlideExecutor.java:446)

0 个答案:

没有答案