My app run fine on android with kivy, so I wanted to use KivyMD to make something a bit better. I began by compiling with just the buildozer requirement added to check if everything is still fine, and it was. But once I import something from kivyMD in my script, the app crash instantly after the splash screen. No other things can make the script crash because it is a very basic hello world app.
here is the script:
from kivymd.app import MDApp #import that makes everything crash
from kivy.uix.screenmanager import Screen
from kivy.uix.label import Label
from kivy.lang import Builder
from kivy.app import App
class test(App):
def build(self):
return Label(text='Hello world')
test().run()
and here is the error that I was able to catch from logcat :
08-02 09:33:56.465 2201 2201 E LoadedApk: Unable to instantiate appComponentFactory
08-02 09:33:56.465 2201 2201 E LoadedApk: java.lang.ClassNotFoundException: Didn't find class "androidx.core.app.CoreComponentFactory" on path: DexPathList[[],nativeLibraryDirectories=[/system/priv-app/MiuiSystemUI/lib/arm64, /system/lib64, /system/product/lib64, /system/lib64, /system/product/lib64]]
08-02 09:33:56.465 2201 2201 E LoadedApk: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:230)
08-02 09:33:56.465 2201 2201 E LoadedApk: at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
08-02 09:33:56.465 2201 2201 E LoadedApk: at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
08-02 09:33:56.465 2201 2201 E LoadedApk: at android.app.LoadedApk.createAppFactory(LoadedApk.java:258)
08-02 09:33:56.465 2201 2201 E LoadedApk: at android.app.LoadedApk.updateApplicationInfo(LoadedApk.java:372)
08-02 09:33:56.465 2201 2201 E LoadedApk: at android.app.ActivityThread.handleApplicationInfoChanged(ActivityThread.java:5799)
08-02 09:33:56.465 2201 2201 E LoadedApk: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2036)
08-02 09:33:56.465 2201 2201 E LoadedApk: at android.os.Handler.dispatchMessage(Handler.java:107)
08-02 09:33:56.465 2201 2201 E LoadedApk: at android.os.Looper.loop(Looper.java:224)
08-02 09:33:56.465 2201 2201 E LoadedApk: at android.app.ActivityThread.main(ActivityThread.java:7590)
08-02 09:33:56.465 2201 2201 E LoadedApk: at java.lang.reflect.Method.invoke(Native Method)
08-02 09:33:56.465 2201 2201 E LoadedApk: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
08-02 09:33:56.465 2201 2201 E LoadedApk: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
I found some answers like this but I don't know how to apply it to a kivy project. I didn't include the buildozer.spec file in this post because it works fine even with kivyMD requirement. I can edit and add it if needed.