当我尝试在Kivy提供的VM中使用buildozer构建Android应用程序时出现错误。我更新了buildozer,并在终端中运行了buildozer init
。我不在共享文件夹中运行它。我收到了这个错误:
Compiling
/home/kivy/Desktop/sf_kopec/.buildozer/android/platform/build/dists/kopeckova/private/lib/python2.7/xml/sax/xmlreader.py ...
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/kivy/Desktop/sf_kopec/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 978, in <module>
main()
File "/home/kivy/Desktop/sf_kopec/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 975, in main
ToolchainCL()
File "/home/kivy/Desktop/sf_kopec/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 512, in __init__
getattr(self, args.subparser_name.replace('-', '_'))(args)
File "/home/kivy/Desktop/sf_kopec/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 150, in wrapper_func
func(self, args)
File "/home/kivy/Desktop/sf_kopec/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 754, in apk
build_args = build.parse_args(args.unknown_args)
File "/home/kivy/Desktop/sf_kopec/.buildozer/android/platform/build/dists/kopeckova/build.py", line 577, in parse_args
make_package(args)
File "/home/kivy/Desktop/sf_kopec/.buildozer/android/platform/build/dists/kopeckova/build.py", line 365, in make_package
url_scheme=url_scheme)
File "/home/kivy/Desktop/sf_kopec/.buildozer/android/platform/build/dists/kopeckova/build.py", line 76, in render
template = environment.get_template(template)
File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 830, in get_template
return self._load_template(name, self.make_globals(globals))
File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 804, in _load_template
template = self.loader.load(self, name, globals)
File "/usr/local/lib/python2.7/dist-packages/jinja2/loaders.py", line 113, in load
source, filename, uptodate = self.get_source(environment, name)
File "/usr/local/lib/python2.7/dist-packages/jinja2/loaders.py", line 187, in get_source
raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: AndroidManifest.tmpl.xml
# Command failed: /usr/bin/python -m pythonforandroid.toolchain apk --debug --bootstrap=sdl2 --dist_name kopeckova --name Kopeckova --version 1.0 --package org.test.kopeckova --android_api 19 --minsdk 9 --private /home/kivy/Desktop/sf_kopec/.buildozer/android/app --presplash /home/kivy/Desktop/sf_kopec/icon.png --icon /home/kivy/Desktop/sf_kopec/icon.png --orientation sensor --intent-filters /home/kivy/Desktop/sf_kopec/AndroidManifest.tmpl.xml --copy-libs --arch armeabi-v7a --color=always --storage-dir=/home/kivy/Desktop/sf_kopec/.buildozer/android/platform/build
#
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2
在显示此错误之前有很多事情发生,但没有任何错误。
在关于缺少默认的kivy app图标和spash图像之前还有两个其他错误,我通过添加图像和编辑buildozer.spec
文件解决了这个问题。除了title
,package.name
和version
之外,我没有在规范文件中更改任何其他内容。我想这是因为缺少默认模板或其他东西。请帮助:)