Comments (21)
使用的版本?
from sketch.
使用的版本?
3.2.1-rc03
from sketch.
你贴出来的异常是从哪儿来的?
from sketch.
能否稳定复现?
from sketch.
可以稳定复现,只要加载附件中的图片就可以复现。
加载的代码是Compose的,但感觉不是这里的问题
AsyncImage(
request = DisplayRequest(LocalContext.current, imgUri.toString()) {
crossfade()
},
contentScale = ContentScale.Crop,
contentDescription = null,
modifier = Modifier
.fillMaxWidth()
.aspectRatio(1.0f)
.clickable(onClick = onClickGoods)
)
from sketch.
报一下Android 版本,你最终的 kotlin 版本,协程版本
from sketch.
报一下Android 版本,你最终的 kotlin 版本,协程版本
Android ="33"
kotlin = "1.8.21"
coroutine = "1.6.4"
from sketch.
我试了捕获到了,没有崩溃,你升级到最新版试试呢
from sketch.
抱歉,是我的问题,没有设置error占位图。设置了就可以了, 测试了3.2.3版本和3.2.1-rc03版本也是没有问题的,
from sketch.
那 App 到底有没有崩溃?我担心的是这个
from sketch.
加了error占位图就没有了崩溃了。不加会崩溃
from sketch.
我试了去掉 error 图片,去掉 placeholder 图片,都不会崩溃,你能否把崩溃过程录个视频,进 QQ 群(529630740)发出来我看看
from sketch.
你说的崩溃是否指的就是 logcat 打印出来的 error 级别的那个异常信息?
from sketch.
你说的崩溃是否指的就是 logcat 打印出来的 error 级别的那个异常信息?
好像加载不是直接原因,直接原因是Compose获取不了大小, 我尝试直接在AsyncImage的Modifier设置size,没有效果。还是会崩溃。
2023-06-21 18:16:33.858 E main - RequestExecutor. Request failed. Invalid image. size=-1x-1. 'content://media/external/images/media/35?_resize=Resize(318x318,Fixed(LESS_PIXELS),Fixed(CENTER_CROP))'
com.github.panpf.sketch.decode.ImageInvalidException: Invalid image. size=-1x-1
at com.github.panpf.sketch.decode.internal.DecodeUtilsKt.readImageInfoWithBitmapFactoryOrThrow(DecodeUtils.kt:434)
at com.github.panpf.sketch.decode.internal.DefaultBitmapDecoder.decode-IoAF18A$suspendImpl(DefaultBitmapDecoder.kt:50)
at com.github.panpf.sketch.decode.internal.DefaultBitmapDecoder.decode-IoAF18A(Unknown Source:0)
at com.github.panpf.sketch.decode.internal.EngineBitmapDecodeInterceptor.intercept-gIAlu-s(EngineBitmapDecodeInterceptor.kt:39)
at com.github.panpf.sketch.decode.internal.BitmapDecodeInterceptorChain.proceed-IoAF18A(BitmapDecodeInterceptorChain.kt:43)
at com.github.panpf.sketch.transform.internal.BitmapTransformationDecodeInterceptor.intercept-gIAlu-s(BitmapTransformationDecodeInterceptor.kt:37)
at com.github.panpf.sketch.decode.internal.BitmapDecodeInterceptorChain.proceed-IoAF18A(BitmapDecodeInterceptorChain.kt:43)
at com.github.panpf.sketch.decode.internal.BitmapResultCacheDecodeInterceptor$intercept$2.invokeSuspend(BitmapResultCacheDecodeInterceptor.kt:57)
at com.github.panpf.sketch.decode.internal.BitmapResultCacheDecodeInterceptor$intercept$2.invoke(Unknown Source:8)
at com.github.panpf.sketch.decode.internal.BitmapResultCacheDecodeInterceptor$intercept$2.invoke(Unknown Source:2)
at com.github.panpf.sketch.decode.internal.BitmapResultCacheDecodeInterceptor.lockResultCache(BitmapResultCacheDecodeInterceptor.kt:76)
at com.github.panpf.sketch.decode.internal.BitmapResultCacheDecodeInterceptor.intercept-gIAlu-s(BitmapResultCacheDecodeInterceptor.kt:53)
at com.github.panpf.sketch.decode.internal.BitmapDecodeInterceptorChain.proceed-IoAF18A(BitmapDecodeInterceptorChain.kt:43)
at com.github.panpf.sketch.decode.internal.DefaultDrawableDecoder.decode-IoAF18A(DefaultDrawableDecoder.kt:41)
at com.github.panpf.sketch.decode.internal.EngineDrawableDecodeInterceptor.intercept-gIAlu-s(EngineDrawableDecodeInterceptor.kt:39)
at com.github.panpf.sketch.decode.internal.DrawableDecodeInterceptorChain.proceed-IoAF18A(DrawableDecodeInterceptorChain.kt:43)
at com.github.panpf.sketch.request.internal.EngineRequestInterceptor$display$decodeResult$1.invokeSuspend(EngineRequestInterceptor.kt:80)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
2023-06-21 18:16:33.879 AndroidRuntime E FATAL EXCEPTION: main
Process: com.gearup.wagon.develop, PID: 20778
java.lang.IllegalStateException: Size is unspecified
at androidx.compose.ui.geometry.Size.getWidth-impl(Size.kt:48)
at com.github.panpf.sketch.compose.UtilsKt.toIntSize-uvyYCjk(Utils.kt:100)
at com.github.panpf.sketch.compose.ContentPainterModifier.draw(ContentPainterModifier.kt:184)
at androidx.compose.ui.node.BackwardsCompatNode.draw(BackwardsCompatNode.kt:361)
at androidx.compose.ui.node.LayoutNodeDrawScope.draw-x_KDEd0$ui_release(LayoutNodeDrawScope.kt:92)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:370)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:359)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:236)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:367)
at androidx.compose.ui.node.NodeCoordinator.access$drawContainedDrawModifiers(NodeCoordinator.kt:58)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:396)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:395)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2200)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:234)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:230)
at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:341)
at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(Unknown Source:1)
at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:230)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:120)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:395)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:58)
at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.android.kt:209)
at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:301)
at androidx.compose.ui.platform.AndroidComposeView.dispatchDraw(AndroidComposeView.android.kt:1046)
at android.view.View.draw(View.java:22353)
at android.view.View.updateDisplayListIfDirty(View.java:21226)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.View.draw(View.java:22081)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at androidx.fragment.app.FragmentContainerView.drawChild(FragmentContainerView.kt:235)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at androidx.fragment.app.FragmentContainerView.dispatchDraw(FragmentContainerView.kt:225)
at android.view.View.updateDisplayListIfDirty(View.java:21217)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
2023-06-21 18:16:33.879 E at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:559)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:565)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:642)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:4101)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3828)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3099)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1952)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8171)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:972)
at android.view.Choreographer.doCallbacks(Choreographer.java:796)
at android.view.Choreographer.doFrame(Choreographer.java:731)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
from sketch.
复现了,你这个描述误导我了,崩溃不是ImageInvalidException直接导致的,是由于任务失败,又没有错误 drawable,导致绘制的时候获取不到可用的 size 信息,最终还是 compose 层面的问题,等我解决把,应该很快
from sketch.
复现了,你这个描述误导我了,崩溃不是ImageInvalidException直接导致的,是由于任务失败,又没有错误 drawable,导致绘制的时候获取不到可用的 size 信息,最终还是 compose 层面的问题,等我解决把,应该很快
辛苦大佬了。我也是一步步弄懂了,我之前就以为是sketch加载的问题
from sketch.
发布了新的 3.2.4-SNAPSHOT 版本,修复了此问题,你试试。
配置快照仓库地址:
maven { setUrl("https://s01.oss.sonatype.org/content/repositories/snapshots") }
然后依赖快照版本
implementation("io.github.panpf.sketch3:sketch:3.2.4-SNAPSHOT")
from sketch.
发布了新的 3.2.4-SNAPSHOT 版本,修复了此问题,你试试。
配置快照仓库地址:
maven { setUrl("https://s01.oss.sonatype.org/content/repositories/snapshots") }
然后依赖快照版本
implementation("io.github.panpf.sketch3:sketch:3.2.4-SNAPSHOT")
测试了这个快照版本,在原来的代码下没有崩溃了。应该是修复好了。(๑•̀ㅂ•́)و✧
from sketch.
好的,还有一个别的问题,等也验证好了就发正式版,应该就在这两天
from sketch.
已发布 3.2.4 正式版
from sketch.
已发布 3.2.4 正式版
11,辛苦大佬
from sketch.
Related Issues (20)
- feat: 加载指定宽度,高度不定的小图片 HOT 11
- sketch 初始化能不能放出来,库里面集成没法在Application中配置 HOT 4
- 加载图片提示URI_INVALID HOT 1
- me.panpf:sketch-gif:2.7.1版本使用targetSdkVersion 31闪退 HOT 2
- such as Glide preloader HOT 1
- release 中的示例 apk 在启动时崩溃 HOT 3
- Missing licenses HOT 2
- [疑问] 在Compose的Lazy组件中, 可以实现滚动中暂停加载图片吗? HOT 2
- 加载图片出现 java.lang.NullPointerException: getHeaderField(...) must not be null HOT 2
- AsyncImage只设置宽度没有设置高度时无法显示图片 HOT 1
- 有的图片明明是正常的,它显示403 HOT 4
- 我想问下到底该如何删除指定key的缓存 HOT 3
- iOS support HOT 3
- 在Compose中加载尺寸较小的图片时, 图片非常模糊 HOT 8
- HurlStack and OkHttpStack cause network concurrency control failure
- Sketch.Builder adds parameters to control the number of concurrent network and decoding
- Scheduling bug: Image decoding will not start until all network tasks are downloaded
- iOS上加载动图时,将app退到后台,三秒后让app回到前台,必然crash,github仓库里的demo可以直接复现 HOT 1
- AppIconUriFetcher.Factory parses versionCode exception
- iOS加载只有一帧的gif图片,会crash HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sketch.