Anyone else having problems using a ComposeView wh...
# compose
h
Anyone else having problems using a ComposeView while enabling minifcation (R8/Proguard)? I am getting the following exception (see thread):
kotlin.reflect.jvm.internal.KotlinReflectionInternalError: Property 'javaClass' (JVM signature: getJavaClass(Ljava/lang/Object;)Ljava/lang/Class;) not resolved in file class kotlin.jvm.JvmClassMappingKt     at kotlin.reflect.jvm.internal.KDeclarationContainerImpl.findPropertyDescriptor(SourceFile:87)     at kotlin.reflect.jvm.internal.KPropertyImpl$_descriptor$1.invoke(SourceFile:102)     at kotlin.reflect.jvm.internal.KPropertyImpl$_descriptor$1.invoke(SourceFile:27)     at kotlin.reflect.jvm.internal.ReflectProperties$LazySoftVal.invoke(SourceFile:92)     at kotlin.reflect.jvm.internal.KPropertyImpl.getDescriptor(SourceFile:105)     at kotlin.reflect.jvm.internal.KPropertyImpl.toString(SourceFile:126)     at kotlin.jvm.internal.PropertyReference.toString(SourceFile:71)     at java.lang.String.valueOf(String.java:2924)     at java.lang.StringBuilder.append(StringBuilder.java:132)     at androidx.compose.ui.platform.DisposableUiSavedStateRegistryKt.DisposableUiSavedStateRegistry(SourceFile:66)     at androidx.compose.ui.platform.DisposableUiSavedStateRegistryKt.DisposableUiSavedStateRegistry(SourceFile:44)     at androidx.compose.ui.platform.AndroidAmbientsKt.ProvideAndroidAmbients(SourceFile:87)     at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(SourceFile:272)     at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Unknown Source:17)     at androidx.compose.runtime.internal.ComposableLambda.invoke(SourceFile:143)     at androidx.compose.runtime.internal.ComposableLambda.invoke(Unknown Source:17)     at androidx.compose.runtime.ComposerKt.invokeComposable(SourceFile:2684)     at androidx.compose.runtime.Composer.composeInitial(SourceFile:1851)     at androidx.compose.runtime.Recomposer.composeInitial$runtime_release(SourceFile:243)     at androidx.compose.runtime.CompositionImpl.setContent(SourceFile:110)     at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(SourceFile:262)     at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Unknown Source:3)     at androidx.compose.ui.platform.AndroidComposeView.setOnViewTreeOwnersAvailable(SourceFile:497)     at androidx.compose.ui.platform.WrappedComposition.setContent(SourceFile:254)     at androidx.compose.ui.platform.WrappedComposition.onStateChanged(SourceFile:303)     at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(SourceFile:354)     at androidx.lifecycle.LifecycleRegistry.forwardPass(SourceFile:265)     at androidx.lifecycle.LifecycleRegistry.sync(SourceFile:307)     at androidx.lifecycle.LifecycleRegistry.moveToState(SourceFile:148)     at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent(SourceFile:134)     at androidx.fragment.app.FragmentViewLifecycleOwner.handleLifecycleEvent(SourceFile:62)     at androidx.fragment.app.Fragment.restoreViewState(SourceFile:631)     at androidx.fragment.app.Fragment.restoreViewState(SourceFile:2945)     at androidx.fragment.app.Fragment.performActivityCreated(SourceFile:2936)     at androidx.fragment.app.FragmentStateManager.activityCreated(SourceFile:577)     at androidx.fragment.app.FragmentManager.moveToState(SourceFile:1329)     at androidx.fragment.app.FragmentManager.addAddedFragments(SourceFile:2392)     at androidx.fragment.app.FragmentManager.executeOpsTogether(SourceFile:2137)     at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(SourceFile:2061)     at androidx.fragment.app.FragmentManager.execPendingActions(SourceFile:1957)     at androidx.fragment.app.FragmentManager$5.run(SourceFile:496)     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)
a
@Andrey Kulikov
a
Interesting. could you please file a bug?
h
Sure, will do so tomorrow...
h
I also got a similar error when I used
coerceIn
, or any other extension function for that matter, inside a
object: DragObserver
function.
c
Copy code
com.android.tools.r8.errors.b: Space characters in SimpleName 'Float$arg-0$call-Size$fun-$get-intrinsicSize$$get$val-intrinsicSize$class-$no name provided$$val-a$fun-ImagePainterSample' are not allowed prior to DEX version 040
a
for that particular trace, I believe we have a fix already in. @Leland Richardson [G] to confirm. You can work around it by giving your anonymous
object
a name, if I recall
l
that is correct
h
@Andrey Kulikov Unfortunately I am not able to reproduce the bug outside the context of the specific app (which is rather complex). I will keep looking for the anomaly causing the issue.
a
could you please file it anyway? I took a look on the sources and seems like we can just stop using the property which was being missing just to be sure to not affect anyone else in a similar way
h
w
I have a similar issue even though I have minification disabled. Anyway we can work around it?