如何使用buildozer和最新的kivy构建kivy应用程序? [英] How to build a kivy application using buildozer and the latest kivy?

查看:159
本文介绍了如何使用buildozer和最新的kivy构建kivy应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用buildozer我已经成功构建并运行了Android应用程序. Buildozer使用kivy稳定(1.7)

Using buildozer I have successfully built and run an Android application. Buildozer uses kivy-stable (1.7)

如何使用最新的kivy 1.8构建kivy应用程序?

How do I build a kivy application using the latest kivy 1.8 ?

我注意到 https://github.com/kivy/python -for-android/blob/master/recipes/kivy/recipe.sh 线路

VERSION_kivy=${VERSION_kivy:-stable}
URL_kivy=https://github.com/kivy/kivy/zipball/$VERSION_kivy/kivy-$VERSION_kivy.zip

这是否意味着只有kivy稳定版本可以与buildozer一起使用?

Does this mean that only the kivy-stable version can be used with buildozer ?

谢谢

推荐答案

我不记得buildozer是否可以使用kivy master(未发布1.8),但是您可以使它正常工作.这里有一些说明,假设您的外壳类似于bash.

I can't remember if buildozer has a switch to use kivy master (1.8 is unreleased), but you can certainly make it work. Here's a few instructions assuming your shell is something bash-like.

首先,创建您自己的本地kivy存储库:

First, create your own local kivy repository:

git clone https://github.com/kivy/kivy.git

第二,导出环境变量P4A_kivy_DIR指向此目录.如果存在此变量,则python-for-android(包括buildozer下载和使用的python)将使用该目录来构建kivy.

Second, export the environment variable P4A_kivy_DIR to point at this directory. If this variable exists, python-for-android (including the one downloaded and used by buildozer) will use that directory to build kivy.

export P4A_kivy_DIR="$PWD/kivy$
echo $P4A_kivy_DIR

第二行应打印出您新克隆的kivy的目录.

The second line should print out the directory of your newly cloned kivy.

然后可以运行buildozer.您可能需要先删除应用程序目录中的.buildozer文件,或更具体地说是删除某些python-for-android组件-最简单的方法就是

You can then run buildozer. You might need to first delete the .buildozer file in your app dir, or more specifically some of the python-for-android components - easiest is just to do

rm -rf /path/to/your/app/.buildozer/android/platform/python-for-android

之后,只需运行buildozer,然后python-for-android组件应使用您的kivy master副本.

After that, just run buildozer and the python-for-android component should use your copy of kivy master.

如果您希望这种行为每次都能自动运行,则可以将导出行放在.bashrc或其他一些合适的Shell设置文件中.如果不这样做,则每次创建或替换.buildozer目录时都需要运行导出行.

If you want this behaviour to automatically work every time, you could put the export line in your .bashrc or some other suitable shell setup file. If you don't do this, you'll need to run the export line every time you create or replace a .buildozer directory.

这篇关于如何使用buildozer和最新的kivy构建kivy应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆