Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
I got the same issue only in a Pixel 5 emulator running API 24. Adding a breakpoint in `loadImageBitmapResource` showed that it was an `OutOfMemoryException` being swallowed like you say. Would be handy if it threw the actual exceptions
ap...@google.com <ap...@google.com> #3
deleted
ap...@google.com <ap...@google.com> #4
I'm experiencing the same thing as well. In my case, it refuses to acknowledge this:
```kotlin
placeholder.xml
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android "
android:height="200dp"
android:viewportHeight="200"
android:viewportWidth="125"
android:width="125dp">
<path
android:fillColor="@color/black"
android:pathData="M 0,0 L 125,0 125,200 0,200z" />
</vector>
```
as a vector drawable when called in
```kotlin
painterResource(id = R.drawable.placeholder)
```
for an Image composable. Furthermore, this is happening on my emulator that has API 30 (Android R) so this issue might not be limited to APIs below or equal to 21.
```kotlin
placeholder.xml
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="
android:height="200dp"
android:viewportHeight="200"
android:viewportWidth="125"
android:width="125dp">
<path
android:fillColor="@color/black"
android:pathData="M 0,0 L 125,0 125,200 0,200z" />
</vector>
```
as a vector drawable when called in
```kotlin
painterResource(id = R.drawable.placeholder)
```
for an Image composable. Furthermore, this is happening on my emulator that has API 30 (Android R) so this issue might not be limited to APIs below or equal to 21.
ap...@google.com <ap...@google.com> #5
Experiencing this issue actually when using Compose preview.
ap...@google.com <ap...@google.com> #6
Experiencing this issue actually when using webp for image in Compose preview. but it still showing.
ap...@google.com <ap...@google.com> #7
having this problem with a JPG on Android 6
ap...@google.com <ap...@google.com> #8
Experiencing the same issue, any updates?
Some notes about the attachments:
- ic_pin.xml: I have the issue with this drawable
- ic_pin_full.xml: no issue with this
Thanks
Some notes about the attachments:
- ic_pin.xml: I have the issue with this drawable
- ic_pin_full.xml: no issue with this
Thanks
ap...@google.com <ap...@google.com> #9
Same issue. It gives me the below stack trace for the following image. The issue has come up so far only on Nexus 5.
java.lang.IllegalArgumentException: Only VectorDrawables and rasterized asset types are supported ex. PNG, JPG
at androidx.compose.ui.res.PainterResources_androidKt.loadImageBitmapResource(PainterResources.android.kt:111)
at androidx.compose.ui.res.PainterResources_androidKt.painterResource(PainterResources.android.kt:70)
at app.storelab.storelabmarketplace.presentation.welcome.WelcomeScreenKt.WelcomeScreen(WelcomeScreen.kt:127)
at app.storelab.storelabmarketplace.presentation.navigation.OnBoardingNavigationKt$OnBoardingNavGraph$1$1.invoke(OnBoardingNavigation.kt:30)
at app.storelab.storelabmarketplace.presentation.navigation.OnBoardingNavigationKt$OnBoardingNavGraph$1$1.invoke(OnBoardingNavigation.kt:29)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:116)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.navigation.compose.NavHostKt$NavHost$4$2.invoke(NavHost.kt:163)
at androidx.navigation.compose.NavHostKt$NavHost$4$2.invoke(NavHost.kt:162)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
at androidx.compose.runtime.saveable.SaveableStateHolderImpl.SaveableStateProvider(SaveableStateHolder.kt:84)
at androidx.navigation.compose.NavBackStackEntryProviderKt.SaveableStateProvider(NavBackStackEntryProvider.kt:60)
at androidx.navigation.compose.NavBackStackEntryProviderKt.access$SaveableStateProvider(NavBackStackEntryProvider.kt:1)
at androidx.navigation.compose.NavBackStackEntryProviderKt$LocalOwnersProvider$1.invoke(NavBackStackEntryProvider.kt:52)
at androidx.navigation.compose.NavBackStackEntryProviderKt$LocalOwnersProvider$1.invoke(NavBackStackEntryProvider.kt:51)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
at androidx.navigation.compose.NavBackStackEntryProviderKt.LocalOwnersProvider(NavBackStackEntryProvider.kt:47)
at androidx.navigation.compose.NavHostKt$NavHost$4.invoke(NavHost.kt:162)
at androidx.navigation.compose.NavHostKt$NavHost$4.invoke(NavHost.kt:141)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:116)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.animation.CrossfadeKt$Crossfade$4$1.invoke(Crossfade.kt:115)
at androidx.compose.animation.CrossfadeKt$Crossfade$4$1.invoke(Crossfade.kt:110)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.animation.CrossfadeKt.Crossfade(Crossfade.kt:124)
at androidx.compose.animation.CrossfadeKt.Crossfade(Crossfade.kt:55)
at androidx.navigation.compose.NavHostKt.NavHost(NavHost.kt:141)
at androidx.navigation.compose.NavHostKt$NavHost$5.invoke(NavHost.kt)
at androidx.navigation.compose.NavHostKt$NavHost$5.invoke(NavHost.kt)
at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:145)
at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2367)
at androidx.compose.runtime.ComposerImpl.skipToGroupEnd(Composer.kt:2657)
at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(ComposeView.android.kt:250)
at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(ComposeView.android.kt:249)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
at androidx.compose.ui.platform.CompositionLocalsKt.ProvideCommonCompositionLocals(CompositionLocals.kt:177)
at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$3.invoke(AndroidCompositionLocals.android.kt:123)
at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$3.invoke(AndroidCompositionLocals.android.kt:122)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt.ProvideAndroidCompositionLocals(AndroidCompositionLocals.android.kt:114)
at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$4.invoke(AndroidCompositionLocals.android.kt)
at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$4.invoke(AndroidCompositionLocals.android.kt)
at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:145)
at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2367)
at androidx.compose.runtime.ComposerImpl.skipCurrentGroup(Composer.kt:2634)
at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3250)
at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3228)
at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:336)
at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations
at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3228)
at androidx.compose.runtime.ComposerImpl.recompose$runtime_release(Composer.kt:3193)
at androidx.compose.runtime.CompositionImpl.recompose(Composition.kt:753)
at androidx.compose.runtime.Recomposer.performRecompose(Recomposer.kt:1031)
at androidx.compose.runtime.Recomposer.access$performRecompose(Recomposer.kt:125)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:534)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:503)
at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.android.kt:34)
at androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch(AndroidUiDispatcher.android.kt:109)
at androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch(AndroidUiDispatcher.android.kt:41)
at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:69)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:856)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at android.view.Choreographer.doFrame(Choreographer.java:603)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5421)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
ap...@google.com <ap...@google.com> #10
Same problem on API 22 emulator when I load the image placeholder for Coil in the lazy grid, it throws OutOfMemoryError
in some point:
I/art ( 2571): Clamp target GC heap from 387MB to 384MB
I/art ( 2571): Alloc concurrent mark sweep GC freed 4848(222KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 383MB/384MB, paused 270us total 21.225ms
E/art ( 2571): Throwing OutOfMemoryError "Failed to allocate a 6350412 byte allocation with 227524 free bytes and 222KB until OOM"
I/art ( 2571): WaitForGcToComplete blocked for 28.530ms for cause Alloc
D/skia ( 2571): --- allocation failed for scaled bitmap
D/AndroidRuntime( 2571): Shutting down VM
--------- beginning of crash
E/AndroidRuntime( 2571): FATAL EXCEPTION: main
E/AndroidRuntime( 2571): Process: org.proninyaroslav.opencomicvine, PID: 2571
E/AndroidRuntime( 2571): java.lang.IllegalArgumentException: Only VectorDrawables and rasterized asset types are supported ex. PNG, JPG
E/AndroidRuntime( 2571): at androidx.compose.ui.res.PainterResources_androidKt.loadImageBitmapResource(PainterResources.android.kt:111)
E/AndroidRuntime( 2571): at androidx.compose.ui.res.PainterResources_androidKt.access$loadImageBitmapResource(PainterResources.android.kt:1)
E/AndroidRuntime( 2571): at androidx.compose.ui.res.PainterResources_androidKt.painterResource(PainterResources.android.kt:70)
E/AndroidRuntime( 2571): at org.proninyaroslav.opencomicvine.ui.components.CharacterCardKt.InnerCharacterCard(CharacterCard.kt:49)
E/AndroidRuntime( 2571): at org.proninyaroslav.opencomicvine.ui.components.CharacterCardKt.CharacterCard(CharacterCard.kt:26)
E/AndroidRuntime( 2571): at org.proninyaroslav.opencomicvine.ui.wiki.characters.CharactersPageKt$CharactersPage$8$2$3$2.invoke(CharactersPage.kt:205)
E/AndroidRuntime( 2571): at org.proninyaroslav.opencomicvine.ui.wiki.characters.CharactersPageKt$CharactersPage$8$2$3$2.invoke(CharactersPage.kt:203)
E/AndroidRuntime( 2571): at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:135)
E/AndroidRuntime( 2571): at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
E/AndroidRuntime( 2571): at androidx.compose.foundation.lazy.grid.ComposableSingletons$LazyGridItemProviderKt$lambda-1$1.invoke(LazyGridItemProvider.kt:88)
E/AndroidRuntime( 2571): at androidx.compose.foundation.lazy.grid.ComposableSingletons$LazyGridItemProviderKt$lambda-1$1.invoke(LazyGridItemProvider.kt:87)
E/AndroidRuntime( 2571): at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:135)
E/AndroidRuntime( 2571): at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
E/AndroidRuntime( 2571): at androidx.compose.foundation.lazy.layout.DefaultLazyLayoutItemsProvider.Item(LazyLayoutItemProvider.kt:118)
E/AndroidRuntime( 2571): at androidx.compose.foundation.lazy.grid.LazyGridItemProviderImpl.Item(LazyGridItemProvider.kt)
E/AndroidRuntime( 2571): at androidx.compose.foundation.lazy.layout.DefaultDelegatingLazyLayoutItemProvider.Item(LazyLayoutItemProvider.kt:197)
E/AndroidRuntime( 2571): at androidx.compose.foundation.lazy.grid.LazyGridItemProviderKt$rememberLazyGridItemProvider$1$1.Item(LazyGridItemProvider.kt)
E/AndroidRuntime( 2571): at androidx.compose.foundation.lazy.layout.LazyLayoutItemContentFactory$CachedItemContent$createContentLambda$1$1.invoke(LazyLayoutItemContentFactory.kt:99)
E/AndroidRuntime( 2571): at androidx.compose.foundation.lazy.layout.LazyLayoutItemContentFactory$CachedItemContent$createContentLambda$1$1.invoke(LazyLayoutItemContentFactory.kt:98)
E/AndroidRuntime( 2571): at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
E/AndroidRuntime( 2571): at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
E/AndroidRuntime( 2571): at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
E/AndroidRuntime( 2571): at androidx.compose.runtime.saveable.SaveableStateHolderImpl.SaveableStateProvider(SaveableStateHolder.kt:84)
E/AndroidRuntime( 2571): at androidx.compose.foundation.lazy.layout.LazySaveableStateHolder.SaveableStateProvider(LazySaveableStateHolder.kt:84)
E/AndroidRuntime( 2571): at androidx.compose.foundation.lazy.layout.LazyLayoutItemContentFactory$CachedItemContent$createContentLambda$1.invoke(LazyLayoutItemContentFactory.kt:98)
E/AndroidRuntime( 2571): at androidx.compose.foundation.lazy.layout.LazyLayoutItemContentFactory$CachedItemContent$createContentLambda$1.invoke(LazyLayoutItemContentFactory.kt:90)
E/AndroidRuntime( 2571): at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
E/AndroidRuntime( 2571): at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
E/AndroidRuntime( 2571): at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$subcompose$2$1$1.invoke(SubcomposeLayout.kt:771)
E/AndroidRuntime( 2571): at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$subcompose$2$1$1.invoke(SubcomposeLayout.kt:448)
E/AndroidRuntime( 2571): at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
E/AndroidRuntime( 2571): at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
E/AndroidRuntime( 2571): at androidx.compose.runtime.ActualJvm_jvmKt.invokeComposable(ActualJvm.jvm.kt:78)
E/AndroidRuntime( 2571): at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3248)
E/AndroidRuntime( 2571): at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer
na...@google.com <na...@google.com> #12
+1. How come in the documentation we come across "we advise to convert png formats to webp for saving more space" and then we cannot use webp with jetpack compose :/
ap...@google.com <ap...@google.com> #13
Same issue here (((
Description