Assigned
Status Update
Comments
kl...@google.com <kl...@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.
ba...@gmail.com <ba...@gmail.com> #6
Experiencing this issue actually when using webp for image in Compose preview. but it still showing.
da...@google.com <da...@google.com> #7
having this problem with a JPG on Android 6
je...@google.com <je...@google.com>
lp...@google.com <lp...@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
is...@gmail.com <is...@gmail.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)
Description
Currently Compose UI tests use an unconfined coroutine dispatcher for all coroutines that are part of the composition (e.g.
LaunchedEffect
,rememberComposeScope
, and even the coroutine running theRecomposer
itself).This is inconsistent with how coroutines are dispatched in non-test environments, where we use the main immediate dispatcher. It is also dangerous because unconfined dispatchers can change the order that code will run in sneaky ways.