You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

执行buildozer android debug deploy run命令时Git克隆失败求助

Hey there! Let's fix that git clone error you're running into when trying to compile your Kivy app into an APK with Buildozer. Here are practical steps to resolve the issue:

解决Buildozer编译APK时的Git克隆失败问题

1. 先确认Git是否正常工作

First up, let's make sure Git is installed and can connect to remote repositories. Open your terminal and run:

git --version

If Git isn't installed, grab it with Mint's package manager:

sudo apt update && sudo apt install git

Test if Git can clone public repos by running:

git clone https://github.com/kivy/kivy.git

If this fails too, you're dealing with a network issue—check your internet connection, or if you're behind a proxy, configure Git to use it.

2. 匹配本地Kivy版本,绕开Git克隆

Since you're using Kivy 1.10.0, you can tell Buildozer to download this exact version directly instead of cloning the repo. Open your project's buildozer.spec file and find the line starting with android.kivy_version, then set it to:

android.kivy_version = 1.10.0

This skips the git clone step entirely, which might bypass the error.

3. 清理Buildozer缓存后重试

Corrupted cached files can cause weird issues. Clear Buildozer's cache first:

buildozer android clean

Then re-run your compile command:

buildozer android debug deploy run

4. 手动克隆依赖仓库

If the above steps don't work, manually clone the required repo to Buildozer's dependency directory. First navigate to the right folder:

mkdir -p ~/.buildozer/android/platform/python-for-android/
cd ~/.buildozer/android/platform/python-for-android/

Then run the exact clone command that failed:

git clone -b stable --single-branch https://github.com/kivy/python-for-android.git

Once it's cloned successfully, go back to your project folder and re-run the Buildozer command.

额外提示:适配老版本Kivy的Buildozer

Kivy 1.10.0 is pretty old, and newer Buildozer versions might have compatibility issues. If nothing else works, try downgrading Buildozer to a version that plays nice with Kivy 1.10.0:

pip install buildozer==0.39

内容的提问来源于stack exchange,提问作者Kasra

火山引擎 最新活动