問題描述
在 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 not found --> no fix found(這就是我重新安裝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 存檔上傳到谷歌驅動器(root 用戶亞歷山大在 ubuntu 中的密碼是 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)
您可以在此處找到壓縮文件: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
安裝 Python-Kivy (http://kivy.org/docs/installation/installation-linux.html#ubuntu-11-10-or-newer) 與
$ sudo add-apt-repository ppa:kivy-team/kivy
$ sudo add-apt-repository ppa:kivy-team/kivy
$ 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:
$ sudo apt-get install python-pip python-dev build-essential
$ sudo apt-get install python-pip python-dev build-essential
構建器的先決條件:需要 zlib、Git、Cython 和 JDK
prerequisites for buildozer: zlib, Git, Cython and JDK is required
$ sudo apt-get install zlib1g-dev git-core cython openjdk-7-jdk
$ sudo apt-get install zlib1g-dev git-core cython openjdk-7-jdk
安裝 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)
$ sudo pip install buildozer
$ sudo pip install 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 初始化
$ buildozer init
$ 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):
導出 PATH=$PATH:/usr/lib/jvm/java-1.6.0-openjdk-i386/bin
export PATH=$PATH:/usr/lib/jvm/java-1.6.0-openjdk-i386/bin
導出 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 初始化
$ buildozer init
(編輯 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 debug deploy 運行
$ buildozer android debug deploy run
這篇關于如何在 Ubuntu 上安裝 Buildozer 以創建 Kivy 應用的 Android APK?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!