https://kotlinlang.org logo
#compose
Title
# compose
e

Erick Sanchez

05/13/2022, 3:39 PM
Hi team!!! I have a question 🙂 Im using AbstractComposeView but when I add the custom view into a XML file, the Android Studio preview show me this error: Some idea of how solved it?
🙏 1
c

curioustechizen

05/13/2022, 3:45 PM
I think Android Studio's XML layout editor does not support previewing composables that you embed in AbstractComposeView.
e

Erick Sanchez

05/13/2022, 3:48 PM
I think so, the problem is that breaks the entire preview
c

curioustechizen

05/13/2022, 3:57 PM
Oh wait sorry I didn't realize that it breaks your entire preview. IIRC (at least in Arctic Fox or 4.x versions of Studio) The rest of the preview would render fine. It would show a placeholder for the AbstractComposeView section
e

Erick Sanchez

05/13/2022, 4:22 PM
Im using
Looks like this!! breaking all the preview
c

Chris Sinco [G]

05/13/2022, 10:48 PM
cc @amaury
🙏 1
a

amaury

05/16/2022, 3:23 PM
Can you try adding a direct dependency to
androidx.lifecycle:lifecycle-runtime
in your project?
it can be a
debugImplementation
dependency, so it's not part of your release APK
we've had a problem with resolving transitive runtime dependencies, but unfortunately the fix is only available in Dolphin
e

Erick Sanchez

05/17/2022, 2:56 PM
Hi @amaury, thanks for answer!!! I tried adding debugImplementation, but continue show the same error
I tried to with Dolphin and no =(
a

amaury

05/19/2022, 11:16 AM
is it the very same error?
2 Views