如何在Kivy发射器中运行kivy 1.9.1应用程序?

时间:2015-07-01 14:02:37

标签: android kivy

我用Kivy 1.9.1-dev写了一个简单的应用程序。当我想在Andriod 2.4设备上使用Kivy启动器测试它时,我得到了

[WARNING           ] stderr: Exception: The version of Kivy installed on this system is too old. (You have 1.9.0, but the application requires 1.9.1)

并且应用程序无法运行。 是否可以在kivy启动器上测试使用1.9.1开发的应用程序?

kivy启动器日志是:

[INFO              ] Logger: Record log in /storage/emulated/0/kivy/wp/.kivy/logs/kivy_15-07-01_4.txt
[INFO              ] Kivy: v1.9.0
[INFO              ] Python: v2.7.2 (default, Apr  2 2015, 13:52:41) 
[GCC 4.8]
[INFO              ] Factory: 173 symbols loaded
[WARNING           ] stderr: /data/data/org.kivy.pygame/files/lib/python2.7/site-packages/kivy/core/image/img_pygame.py:13: RuntimeWarning: import cdrom: No module named cdrom
[WARNING           ] stderr: (ImportError: No module named cdrom)
[INFO              ] Image: Providers: img_tex, img_dds, img_gif, img_pygame, img_pil (img_ffpyplayer ignored)
[INFO              ] Text: Provider: pygame
[INFO              ] Window: Provider: pygame
[INFO              ] GL: OpenGL version <OpenGL ES 2.0 17.01214>
[INFO              ] GL: OpenGL vendor <NVIDIA Corporation>
[INFO              ] GL: OpenGL renderer <NVIDIA Tegra>
[INFO              ] GL: OpenGL parsed version: 2, 0
[INFO              ] GL: Texture max size <4096>
[INFO              ] GL: Texture max units <16>
[INFO              ] Shader: fragment shader: <14 lines, 0 errors.>
[INFO              ] Shader: vertex shader: <23 lines, 0 errors.>
[INFO              ] Support: Android install hooks
[INFO              ] Window: virtual keyboard not allowed, single mode, not docked
[WARNING           ] stderr: Traceback (most recent call last):
[WARNING           ] stderr:   File "main.py", line 108, in <module>
[WARNING           ] stderr:     WPApp().run()
[WARNING           ] stderr:   File "/home/tito/code/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/app.py", line 797, in run
[WARNING           ] stderr:   File "/home/tito/code/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/app.py", line 594, in load_kv
[WARNING           ] stderr:   File "/home/tito/code/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/lang.py", line 1749, in load_file
[WARNING           ] stderr:   File "/home/tito/code/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/lang.py", line 1796, in load_string
[WARNING           ] stderr:   File "/home/tito/code/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/lang.py", line 1185, in __init__
[WARNING           ] stderr:   File "/home/tito/code/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/lang.py", line 1284, in parse
[WARNING           ] stderr:   File "/home/tito/code/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/lang.py", line 1197, in execute_directives
[WARNING           ] stderr:   File "/home/tito/code/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/__init__.py", line 127, in require
[WARNING           ] stderr: Exception: The version of Kivy installed on this system is too old. (You have 1.9.0, but the application requires 1.9.1)

由于

3 个答案:

答案 0 :(得分:1)

要回答您的直接问题,您需要使用python-for-android构建自己的kivy启动器版本(它具有指定此参数的参数)。

但是,如果您发布代码,我们可以检查它是否真的需要1.9.1,并找出导致问题的原因。

答案 1 :(得分:0)

您可以在代码开头指定kivy版本,如下所示:

import kivy
kivy.require("1.9.0")

答案 2 :(得分:0)

升级您的kivy版本:

python3 -m pip install --upgrade kivy

然后添加:

import kivy
kivy.require("versionkivy") #kivy.require("1.11.0")