現在KivyおよびKivyMDで作成したアプリケーションをAndroid用のAPKにしようと四苦八苦しています。
環境は
Buildozer 1.2.0
macOS Mojave 10.14.6
Android 10
です。
調べていくうちに、KivyMDにPillowが必要だということで、buildozer.specのrequirementsにPillowを追加して再度パッケージングしたのですが、パッケージングまでは正常に終了するにも関わらず、作成されたAPKは
ModuleNotFoundError: No module named 'PIL'
で弾かれます。 pipenv環境を試したり、buildozerをmaster、developで変えたりなどしましたが解決の糸口が見つからず困っています。 解決方法をお教えください。
以下に必要そうな情報を載せます。不足していたら教えてください。
buildozer.spec
# (str) Title of your application title = Jimaku # (str) Package name package.name = jimaku # (str) Package domain (needed for android/ios packaging) package.domain = jp.ultharpython # (list) Source files to include (let empty to include all the files) source.include_exts = py,png,jpg,kv,atlas,ttf # (list) Application requirements # comma separated e.g. requirements = sqlite3,kivy requirements = python3,kivy==2.0.0,kivymd==0.104.2,sdl2_ttf == 2.0.15,Pillow # (str) python-for-android branch to use, defaults to master #p4a.branch = develop
androidで実行時に
adb logcat -s python
で出力されたlog
09-17 10:55:41.636 11447 11481 I python : Android kivy bootstrap done. __name__ is __main__ 09-17 10:55:41.636 11447 11481 I python : AND: Ran string 09-17 10:55:41.636 11447 11481 I python : Run user program, change dir and execute entrypoint 09-17 10:55:41.637 11447 11481 I python : <built-in function getcwd> 09-17 10:55:41.711 11447 11481 I python : [WARNING] [Config ] Older configuration version detected (0 instead of 21) 09-17 10:55:41.711 11447 11481 I python : [WARNING] [Config ] Upgrading configuration in progress. 09-17 10:55:41.714 11447 11481 I python : [INFO ] [Logger ] Record log in /data/user/0/jp.ultharpython.jimaku/files/app/.kivy/logs/kivy_21-09-17_0.txt 09-17 10:55:41.714 11447 11481 I python : [INFO ] [Kivy ] v2.0.0 09-17 10:55:41.714 11447 11481 I python : [INFO ] [Kivy ] Installed at "/data/user/0/jp.ultharpython.jimaku/files/app/_python_bundle/site-packages/kivy/__init__.pyc" 09-17 10:55:41.714 11447 11481 I python : [INFO ] [Python ] v3.8.9 (default, Sep 17 2021, 10:42:34) 09-17 10:55:41.714 11447 11481 I python : [Clang 8.0.2 (https://android.googlesource.com/toolchain/clang 40173bab62ec7462 09-17 10:55:41.714 11447 11481 I python : [INFO ] [Python ] Interpreter at "" 09-17 10:55:41.716 11447 11481 I python : [INFO ] [KivyMD ] 0.104.2, git-bc7d1f5, 2021-06-06 (installed at "/data/user/0/jp.ultharpython.jimaku/files/app/_python_bundle/site-packages/kivymd/__init__.pyc") 09-17 10:55:41.718 11447 11481 I python : [INFO ] [Factory ] 186 symbols loaded 09-17 10:55:42.451 11447 11481 I python : [INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2 (img_pil, img_ffpyplayer ignored) 09-17 10:55:42.470 11447 11481 I python : [INFO ] [Text ] Provider: sdl2 09-17 10:55:42.653 11447 11481 I python : [INFO ] [Window ] Provider: sdl2 09-17 10:55:42.669 11447 11481 I python : [INFO ] [GL ] Using the "OpenGL ES 2" graphics system 09-17 10:55:42.669 11447 11481 I python : [INFO ] [GL ] Backend used <sdl2> 09-17 10:55:42.669 11447 11481 I python : [INFO ] [GL ] OpenGL version <b'OpenGL ES 3.2 V@415.0 (GIT@34b6654, Id4a1c1aeea, 1569595379) (Date:09/27/19)'> 09-17 10:55:42.670 11447 11481 I python : [INFO ] [GL ] OpenGL vendor <b'Qualcomm'> 09-17 10:55:42.670 11447 11481 I python : [INFO ] [GL ] OpenGL renderer <b'Adreno (TM) 630'> 09-17 10:55:42.670 11447 11481 I python : [INFO ] [GL ] OpenGL parsed version: 3, 2 09-17 10:55:42.670 11447 11481 I python : [INFO ] [GL ] Texture max size <16384> 09-17 10:55:42.670 11447 11481 I python : [INFO ] [GL ] Texture max units <16> 09-17 10:55:42.695 11447 11481 I python : [INFO ] [Window ] auto add sdl2 input provider 09-17 10:55:42.696 11447 11481 I python : [INFO ] [Window ] virtual keyboard not allowed, single mode, not docked 09-17 10:55:42.761 11447 11481 I python : Traceback (most recent call last): 09-17 10:55:42.761 11447 11481 I python : File "/Users/shogo/Desktop/shogo/kivy/jimaku/.buildozer/android/app/main.py", line 6, in <module> 09-17 10:55:42.761 11447 11481 I python : File "/Users/shogo/Desktop/shogo/kivy/jimaku/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/jimaku/kivymd/uix/__init__.py", line 8, in <module> 09-17 10:55:42.761 11447 11481 I python : File "/Users/shogo/Desktop/shogo/kivy/jimaku/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/jimaku/kivymd/uix/behaviors/__init__.py", line 10, in <module> 09-17 10:55:42.761 11447 11481 I python : File "/Users/shogo/Desktop/shogo/kivy/jimaku/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/jimaku/kivymd/uix/behaviors/backgroundcolor_behavior.py", line 25, in <module> 09-17 10:55:42.762 11447 11481 I python : File "/Users/shogo/Desktop/shogo/kivy/jimaku/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/jimaku/kivymd/uix/behaviors/elevation.py", line 364, in <module> 09-17 10:55:42.762 11447 11481 I python : ModuleNotFoundError: No module named 'PIL' 09-17 10:55:42.762 11447 11481 I python : Python for android ended.
多くなって申し訳ありませんが助言お願いします。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2021/09/21 01:32