Hi all. I have an Android Studio project with two ...
# compose
f
Hi all. I have an Android Studio project with two modules, the default
:app
and
:mymodule
. I added jetpack compose support only in
:mymodule
and I only have a
ComposeView
inside a
Fragment
, and when I run from
:app
everything is good I can see the compose view on the screen. The problem is when I want to use
:mymodule
in another project. The project runs without errors but when the Fragment is shown I get an error:
Copy code
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: <http://com.sample.app|com.sample.app>, PID: 5827
    android.view.InflateException: Binary XML file line #8 in <http://com.sample.app:layout/fragment_main|com.sample.app:layout/fragment_main>: Binary XML file line #8 in <http://com.sample.app:layout/fragment_main|com.sample.app:layout/fragment_main>: Error inflating class androidx.compose.ui.platform.ComposeView
    Caused by: android.view.InflateException: Binary XML file line #8 in <http://com.sample.app:layout/fragment_main|com.sample.app:layout/fragment_main>: Error inflating class androidx.compose.ui.platform.ComposeView
    Caused by: java.lang.ClassNotFoundException: androidx.compose.ui.platform.ComposeView

...

E/AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.compose.ui.platform.ComposeView" on path: DexPathList[[zip file "/data/app/~~Dt8adcn5LfI60uNWAO8AM==/com.sample.app-Msu_NBAxhXzHKoexmlnj-w==/base.apk"],nativeLibraryDirectories=[/data/app/~~Dt8adcn5LfI60uNWAO8AM==/com.sample.app-Msu_NBAxhXzHKoexmlnj-w==/lib/x86, /data/app/~~Dt8adcn5LfI60uNWAO8AM==/com.sample.app-Msu_NBAxhXzHKoexmlnj-w==/base.apk!/lib/x86, /system/lib, /system_ext/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
...