问题描述
在Ubuntu 13.10上安装buildozer并不容易.我几次重新安装了Ubuntu,现在我想分享一下我如何安装buildozer.
It's not easy to install buildozer on Ubuntu 13.10. I reinstalled Ubuntu several times and now I'd like to share how I installed buildozer.
我从buildozer中收到以下错误:
I got the following errors from buildozer:
- ./distribute.sh未找到->未找到修复程序(这就是为什么我两次重新安装Ubuntu,可能是python安装问题,但我不确定)
- _add_java_src()失败->添加正确的Java JDK路径进行修复
推荐答案
下面描述的过程对我来说是完美的:
我已将其安装在Windows 7(64位)主机系统中的虚拟机(VMware播放器)中的Ubuntu 13.10(32位)的全新安装中.
The procedure described below was working perfectly for me:
I've installed it in a fresh installation of Ubuntu 13.10 (32bit) inside a virtual machine (VMware player) in Windows 7 (64bit) host system.
我决定使用32位,因为VM使用的RAM不多,并且不需要64位系统.但是64位Ubuntu也可能会工作(未经测试).我将VMWare文件的zip存档上传到了Google驱动器(Ubuntu中root用户亚历山大的密码是UbuntuBuildozer)
I decided to use 32 bit because the VM uses not that much RAM and a 64bit system is not needed. But 64bit Ubuntu will probably also work (not tested). I uploaded the zip archive of the VMWare files to google drive (password in ubuntu for root user alexander is UbuntuBuildozer)
您可以在此处找到zip文件: https: //drive.google.com/file/d/0B5m9_RVHCpL-YmxPVnVaYWZyZ2s/edit?usp=sharing
You can find the zip-file here: https://drive.google.com/file/d/0B5m9_RVHCpL-YmxPVnVaYWZyZ2s/edit?usp=sharing
$ sudo apt-get更新
$ sudo apt-get update
$ sudo apt-get install python-kivy
$ sudo apt-get install python-kivy
安装pip(如果尚未安装):
install pip, if you haven't got it:
buildozer的先决条件:需要zlib,Git,Cython和JDK
prerequisites for buildozer:zlib, Git, Cython and JDK is required
安装Java JDK指南( http://tecadmin.net/install-java- jdk-ubuntu/#)
install Java JDK guide (http://tecadmin.net/install-java-jdk-ubuntu/#)
安装buildozer( https://github.com/kivy/buildozer )
install buildozer (https://github.com/kivy/buildozer)
初始化buildozer并开始调试(仅安装Andriod SDK,NDK和ANT-无需main.py,这需要几分钟的时间):
initialize buildozer and start with debug (just to install Andriod SDK, NDK & ANT - no main.py needed yet, this takes several minutes):
$ buildozer android调试
$ buildozer android debug
如果buildozer在_add_java_src()处失败:在/home/yourusername/.bashrc中添加JDK路径-在末尾添加这些行(重要的是使用1.x JDK而不是java-7路径):
If buildozer fails at _add_java_src(): Add JDK path in /home/yourusername/.bashrc - add these lines at the end (important use 1.x JDK and not java-7 path):
export JAVA_HOME =/usr/lib/jvm/java-1.6.0-openjdk-i386
export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-i386
现在转到您的应用程序main.py并执行以下命令:
Now go to your apps main.py and do the following commands:
(编辑buildozer.spec并更改您的应用名称,并检查第28/29行或第32行的版本控制->取决于您的main.py代码
看到这样的答案 Buildozer编译简单的android kivy应用程序,但是打包时失败)
(edit buildozer.spec and change your app name and check the versioning on line 28/29 or line 32 --> depends on your main.py code
see SO answer to Buildozer compiles simple android kivy application, but fails while packaging)
$ buildozer android调试部署运行
$ buildozer android debug deploy run
这篇关于如何在Ubuntu上安装Buildozer,以创建Kivy App的Android APK?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!