首页 > 解决方案 > 在 VM 中使用 buildozer 构建时缺少 AndroidManifest.tmpl.xml

问题描述

当我尝试在 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 应用程序图标和 spash 图像的错误,我通过添加图像和编辑buildozer.spec文件解决了这些错误。我没有更改规范文件中的任何其他内容,除了title,package.nameversion. 我猜这是因为缺少默认模板或其他原因。请帮忙 :)

标签: androidpythonlinuxkivybuildozer

解决方案


推荐阅读