Android Kivy Buildozer无法构建apk,命令失败:./distribute.sh-m";“基维”;D

Android Kivy Buildozer无法构建apk,命令失败:./distribute.sh-m";“基维”;D,android,ubuntu,kivy,adk,Android,Ubuntu,Kivy,Adk,我正在尝试使用Kivy和Buildozer构建APK,当我运行“Buildozer android debug”时,我收到以下错误作为响应: a ./distribute.sh: line 371: test: too many arguments ./distribute.sh: line 372: test: too many arguments ./distribute.sh: line 373: test: too many arguments ./distribute.sh: line

我正在尝试使用Kivy和Buildozer构建APK,当我运行“Buildozer android debug”时,我收到以下错误作为响应:

a
./distribute.sh: line 371: test: too many arguments
./distribute.sh: line 372: test: too many arguments
./distribute.sh: line 373: test: too many arguments
./distribute.sh: line 374: test: too many arguments
./distribute.sh: line 377: $SRC_PATH/default.properties: ambiguous redirect
./distribute.sh: line 378: $SRC_PATH/local.properties: ambiguous redirect
cp: cannot create regular file ‘x/.buildozer/android/platform/python-for-android/.git/objects/pack/pack-b89e3f872ff0b0fbbaa9c0f1182451f8506241dc.idx’: Permission denied
cp: cannot create regular file ‘x/.buildozer/android/platform/python-for-android/.git/objects/pack/pack-b89e3f872ff0b0fbbaa9c0f1182451f8506241dc.pack’: Permission denied
cp: cannot copy a directory, ‘/home/tom/Dropbox/Work’, into itself, ‘Test/.buildozer/android/platform/python-for-android/build/Work’
cp: will not create hard link x’ to directory ‘y’
cp: will not create hard link ‘x’ to directory ‘y’
cp: will not create hard link ‘x’ to directory ‘y’
cp: will not create hard link ‘x’ to directory ‘y’
cp: will not create hard link ‘x’ to directory ‘y’
cp: cannot stat ‘Test/.buildozer/android/platform/python-for-android/src/blacklist.txt’: No such file or directory
cp: will not create hard link ‘x’ to directory ‘y’
cp: will not create hard link ‘x’ to directory ‘y’
cp: will not create hard link ‘x’ to directory ‘y’
cp: will not create hard link ‘x’ to directory ‘y’
cp: will not create hard link ‘x’ to directory ‘y’
cp: will not create hard link ‘x’ to directory ‘y’
# Command failed: ./distribute.sh -m "kivy" -d "pongtest"
它似乎正在经历一个奇怪的重定向,但不幸的是它返回了一个不明确的错误消息,所以如果有人对它可能是什么有任何想法,他们将不胜感激。谢谢

这是推土机的规格:

# (str) Title of your application
title = Pong Test

# (str) Package name
package.name = pongtest

# (str) Package domain (needed for android/ios packaging)
package.domain = org.test

# (str) Source code where the main.py live
source.dir = .

# (list) Source files to include (let empty to include all the files)
source.include_exts = py,png,jpg,kv,atlas

# (list) Source files to exclude (let empty to not exclude anything)
#source.exclude_exts = spec

# (list) List of directory to exclude (let empty to not exclude anything)
#source.exclude_dirs = tests, bin

# (list) List of exclusions using pattern matching
#source.exclude_patterns = license,images/*/*.jpg

# (str) Application versioning (method 1)
version.regex = __version__ = '(.*)'
version.filename = %(source.dir)s/main.py

# (str) Application versioning (method 2)
# version = 1.2.0

# (list) Application requirements
requirements = kivy

# (list) Garden requirements
#garden_requirements =

# (str) Presplash of the application
#presplash.filename = %(source.dir)s/data/presplash.png

# (str) Icon of the application
#icon.filename = %(source.dir)s/data/icon.png

# (str) Supported orientation (one of landscape, portrait or all)
orientation = landscape

# (bool) Indicate if the application should be fullscreen or not
fullscreen = 1


#
# Android specific
#

# (list) Permissions
#android.permissions = INTERNET

# (int) Android API to use
#android.api = 14

# (int) Minimum API required (8 = Android 2.2 devices)
#android.minapi = 8

# (int) Android SDK version to use
#android.sdk = 21

# (str) Android NDK version to use
#android.ndk = 9c

# (bool) Use --private data storage (True) or --dir public storage (False)
#android.private_storage = True

# (str) Android NDK directory (if empty, it will be automatically downloaded.)
#android.ndk_path =

# (str) Android SDK directory (if empty, it will be automatically downloaded.)
#android.sdk_path = 

# (str) python-for-android git clone directory (if empty, it will be automatically cloned from github)
#android.p4a_dir =

# (str) Android entry point, default is ok for Kivy-based app
#android.entrypoint = org.renpy.android.PythonActivity

# (list) List of Java .jar files to add to the libs so that pyjnius can access
# their classes. Don't add jars that you do not need, since extra jars can slow
# down the build process. Allows wildcards matching, for example:
# OUYA-ODK/libs/*.jar
#android.add_jars = foo.jar,bar.jar,path/to/more/*.jar

# (list) List of Java files to add to the android project (can be java or a
# directory containing the files)
#android.add_src =

# (str) python-for-android branch to use, if not master, useful to try
# not yet merged features.
#android.branch = master

# (str) OUYA Console category. Should be one of GAME or APP
# If you leave this blank, OUYA support will not be enabled
#android.ouya.category = GAME

# (str) Filename of OUYA Console icon. It must be a 732x412 png image.
#android.ouya.icon.filename = %(source.dir)s/data/ouya_icon.png

# (str) XML file to include as an intent filters in <activity> tag
#android.manifest.intent_filters = 

# (list) Android additionnal libraries to copy into libs/armeabi
#android.add_libs_armeabi = libs/android/*.so

# (bool) Indicate whether the screen should stay on
# Don't forget to add the WAKE_LOCK permission if you set this to True
#android.wakelock = False

# (list) Android application meta-data to set (key=value format)
#android.meta_data =

# (list) Android library project to add (will be added in the
# project.properties automatically.)
#android.library_references =
[buildozer]

# (int) Log level (0 = error only, 1 = info, 2 = debug (with command output))
log_level = 2
应用程序的
#(str)标题
标题=乒乓球测试
#(str)包名
package.name=pongtest
#(str)包域(android/ios包需要)
package.domain=org.test
#(str)main.py所在的源代码
source.dir=。
#(列出)要包括的源文件(设为空以包括所有文件)
source.include_exts=py、png、jpg、kv、atlas
#(列表)要排除的源文件(设为空不排除任何内容)
#source.exclude_exts=spec
#(列表)要排除的目录列表(设为空不排除任何内容)
#source.exclude_dirs=测试,bin
#(列表)使用模式匹配的排除列表
#source.exclude_patterns=许可证,图像/*/*.jpg
#(str)应用程序版本控制(方法1)
version.regex=\uuuuuuuuuuuuuuuuu版本='(.*)”
version.filename=%(source.dir)s/main.py
#(str)应用程序版本控制(方法2)
#版本=1.2.0
#(列表)申请要求
要求=基维
#(列表)花园要求
#园林绿化要求=
#(str)应用程序的预剥离
#presplash.filename=%(source.dir)s/data/presplash.png
#(str)应用程序的图标
#icon.filename=%(source.dir)s/data/icon.png
#(str)支撑方向(横向、纵向或全部)
方向=风景
#(bool)指示应用程序是否应全屏显示
全屏显示=1
#
#特定于Android的
#
#(列表)权限
#android.permissions=互联网
#(int)要使用的Android API
#android.api=14
#(int)所需的最低API(8=安卓2.2设备)
#android.minapi=8
#(int)要使用的Android SDK版本
#android.sdk=21
#(str)要使用的Android NDK版本
#android.ndk=9c
#(bool)使用--private data storage(真)或--dir public storage(假)
#android.private_storage=True
#(str)Android NDK目录(如果为空,将自动下载。)
#android.ndk_路径=
#(str)Android SDK目录(如果为空,将自动下载。)
#android.sdk_路径=
#(str)android git克隆目录的python(如果为空,将自动从github克隆)
#android.p4a_目录=
#(str)Android入口点,基于Kivy的应用程序默认为ok
#android.entrypoint=org.renpy.android.PythonActivity
#(list)要添加到libs以便pyjnius可以访问的Java.jar文件列表
#他们的课。不要添加你不需要的罐子,因为额外的罐子会减慢速度
#在构建过程中。允许通配符匹配,例如:
#OUYA-ODK/libs/*.jar
#android.add_jars=foo.jar、bar.jar、path/to/more/*.jar
#(列表)要添加到android项目的Java文件列表(可以是Java或
#包含文件的目录)
#android.add\u src=
#(str)android branch使用的python,如果不是master,可以尝试
#尚未合并的功能。
#android.branch=master
#(str)OUYA控制台类别。应该是游戏或应用程序之一
#如果将此项留空,将不会启用OUYA支持
#android.ouya.category=游戏
#(str)OUYA控制台图标的文件名。它必须是732x412 png图像。
#android.ouya.icon.filename=%(source.dir)s/data/ouya_icon.png
#(str)XML文件,作为意图过滤器包含在标记中
#android.manifest.intent_过滤器=
#(列表)要复制到libs/armeabi的Android附加库
#android.add_libs_armeabi=libs/android/*.so
#(bool)指示屏幕是否应保持打开状态
#如果将此设置为True,请不要忘记添加唤醒锁定权限
#android.wakelock=False
#(列表)要设置的Android应用程序元数据(键=值格式)
#android.meta_数据=
#(列表)要添加的Android库项目(将添加到
#project.properties自动生成。)
#android.library\u参考=
[建筑商]
#(int)日志级别(0=仅错误,1=信息,2=调试(带命令输出))
日志级别=2

我在Kubuntu上遇到类似问题,导致错误:

# Command failed: ./distribute.sh -m "kivy" -d "kivyapptest"
我是在Kubuntu客户虚拟机上构建的,但我的文件位于主机(我的Macbook Pro)的共享文件夹中


在将
buildozer.spec
main.py
复制到我的Kubuntu主文件夹中的一个文件夹中,并重建(当然使用
sudo
权限)之后,我最终得到了我的.apk文件。

将文件移动到主文件夹(部署的包将存储在那里)。这很奇怪,但对我来说奏效了-我将main.py和spec移到了Macintosh HD,在那里创建了部署。

存在权限问题!当我使用chmod 777时,hole source dir(孔源目录)可以正常工作(但我不建议将其作为修复:)

我刚刚遇到了这个错误,并发现这是由于父目录的名称中有空格和括号造成的:

作品:“范例副本”
不起作用:“示例(复制)”

这是您第一次使用buildozer,还是以前使用过?假设是前者,你能发布你的buildozer.spec吗?你应该编辑原始帖子,将buildozer.spec包含在内,而不是将人们发送到一个粗略的文件上传站点。@brousch是的,对此很抱歉,我将其添加到了原始帖子中。你有一些我以前没有见过的奇怪错误。请确保您的Buildozer和python for android是最新的,您没有在远程安装的驱动器上运行,也没有在加密的驱动器上运行。@brousch Yep,我没有在远程或加密的驱动器上运行,我刚刚更新并重试,得到了相同的错误读数。切勿使用sudo运行Buildozer。从未。