0

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.

  • Just asking, what is your kivy version? Kivymd required kivy==2 – Epsi95 Aug 02 '21 at 13:19
  • 2.0.0 is the last version, as i installed it today it must be 2.0.0 – ThaaoBlues Aug 02 '21 at 13:56
  • in your .spec file make sure `requirements = python3,kivy==2.0.0,kivymd,pygments,sdl2_ttf==2.0.15,pillow` for example – Epsi95 Aug 02 '21 at 16:19
  • I have exactly the same requirements and the good jdk version for buildozer :/ Maybe I forgot to set a paramater in buildozer.spec in gradle build options ? – ThaaoBlues Aug 02 '21 at 18:46
  • Please add the .spec file – Epsi95 Aug 02 '21 at 19:17
  • I managed to erase some cache with ``buildozer android clean`` and it worked. I don't am really able to tell why but it worked . Thanks a lot for using your time to help me ! – ThaaoBlues Aug 02 '21 at 19:39

0 Answers0