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

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

问题描述

使用 buildozer 我已经成功构建并运行了一个 Android 应用程序.Buildozer 使用 kivy-stable (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-stable 版本可以与 buildozer 一起使用?

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

谢谢

推荐答案

我不记得 buildozer 是否有使用 kivy master 的开关(1.8 未发布),但你当然可以让它工作.这里有一些说明,假设你的 shell 类似于 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 下载和使用的那个)将使用该目录来构建 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天全站免登陆