kivymd 应用程序在 Android 手机上崩溃 ModuleNotFound

kivymd app crashes on android phone ModuleNotFoundError: No module named #39;PIL#39;(kivymd 应用程序在 Android 手机上崩溃 ModuleNotFoundError: No module named PIL)
本文介绍了kivymd 应用程序在 Android 手机上崩溃 ModuleNotFoundError: No module named 'PIL'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 Kivy 应用在 Android 手机上启动时崩溃.buildozer logcat 显示如下错误:

My Kivy app crashes on launch on android phone. buildozer logcat shows the following error:

02-21 17:09:58.777 14941 14979 I python  :  ModuleNotFoundError: No module named 'PIL'
02-21 17:09:58.777 14941 14979 I python  : Python for android ended.

这是我的 buildozer.spec 要求:

Here are my buildozer.spec requirements:

requirements = python3,kivy==2.0.0,git+https://github.com/HeaTTheatR/KivyMD.git,sdl2_ttf==2.0.15,python-dateutil,requests,urllib3,chardet,idna,plyer,android,jnius,oscpy

据我了解,只有 KivyMD 依赖于 PIL.该应用程序在我的 Mac 上完美运行,并且之前在 android 手机上运行过.错误刚刚开始发生.所以,我真的很困惑,希望能得到任何帮助.提前致谢!

As I understand, only the KivyMD depends on PIL. The app works perfectly on my mac and WAS working before on the android phone. The error just started to occur. So, I'm really confused and would appreciate any help. Thanks in advance!

推荐答案

您可能已经知道,KivyMD 依赖于 PIL,而不是 Kivy.您在应用程序中使用最新版本的 KivyMD,这取决于 PIL.要消除错误,只需在 buildozer.spec 文件的 requirements 中添加 pillow.

As you might already know, KivyMD depends on PIL, not Kivy. You are using the latest version of KivyMD using git in your app, which depends on PIL. To remove the error just add pillow in the requirements of your buildozer.spec file.

这篇关于kivymd 应用程序在 Android 手机上崩溃 ModuleNotFoundError: No module named 'PIL'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How to target newer versions in .gitlab-ci.yml using auto devops (java 11 instead of 8 and Android 31 instead of 29)(如何在.gitlab-ci.yml中使用自动开发工具(Java 11而不是8,Android 31而不是29)瞄准较新的版本)
Android + coreLibraryDesugaring: which Java 11 APIs can I expect to work?(Android+core LibraryDesugering:我可以期待哪些Java 11API能够工作?)
How to render something in an if statement React Native(如何在If语句中呈现某些内容Reaction Native)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Using Firebase Firestore in offline only mode(在仅脱机模式下使用Firebase FiRestore)
Crash on Google Play Pre-Launch Report: java.lang.NoSuchMethodError(Google Play发布前崩溃报告:java.lang.NoSuchMethodError)