You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在Kivy虚拟机中用Buildozer构建时缺失AndroidManifest.tmpl.xml

Fixing jinja2.exceptions.TemplateNotFound: AndroidManifest.tmpl.xml in Buildozer for Kivy Android Apps

Let's fix that annoying jinja2.exceptions.TemplateNotFound: AndroidManifest.tmpl.xml error you're hitting when building your Kivy Android app with Buildozer in the Kivy VM. Here's what's going wrong and how to fix it step by step:

1. Fix your buildozer.spec manifest configuration

Looking at your error log, the build command includes --intent-filters /home/kivy/Desktop/sf_kopec/AndroidManifest.tmpl.xml—that's the core issue! You've accidentally set your manifest template path in the android.manifest.intent_filters field instead of the correct dedicated field for templates.

  • If you want to use a custom AndroidManifest template:
    Open your buildozer.spec file and set this line (make sure the template file exists in your project root folder):
    android.manifest.template = AndroidManifest.tmpl.xml
    
  • If you don't need a custom template:
    Just delete the android.manifest.intent_filters line entirely. Buildozer will automatically use its default manifest template from the python-for-android toolchain—no manual setup needed.

2. Verify the template file (if using a custom one)

If you're sticking with a custom manifest template:

  • Confirm AndroidManifest.tmpl.xml is actually present in your project root directory (the same folder where you ran buildozer init).
  • Double-check the file name matches exactly what's in your buildozer.spec—case sensitivity matters on Linux-based systems like the Kivy VM.

3. Clear Buildozer's cache and rebuild

Old cached build files can sometimes cause weird configuration conflicts. Run these commands to start fresh:

buildozer android clean
buildozer android debug

4. Ensure your python-for-android toolchain is complete

If the default template is missing (unlikely but possible), updating the python-for-android toolchain can fix it:

pip install --upgrade python-for-android

You can also enable automatic SDK/toolchain updates in your buildozer.spec by adding:

android.sdk_update = True

Then rebuild to let Buildozer fetch any missing files.

Why this happened

The error occurs because Buildozer was told to treat your manifest template file as an intent filter rule (via the --intent-filters flag). Intent filters are for things like letting your app open specific URLs or file types—not for specifying manifest templates. When Buildozer tried to process this as an intent filter, it couldn't find the expected template structure, hence the TemplateNotFound error.

内容的提问来源于stack exchange,提问作者Jakub Bláha

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.28 10:17:59