kivy / buildozer

Generic Python packager for Android and iOS
https://buildozer.readthedocs.io
MIT License
1.71k stars 497 forks source link

bash: error with creating apk via buildozer #1845

Open MrmaderatorYT opened 1 month ago

MrmaderatorYT commented 1 month ago

Wanna create apk file using kivy via buildozer using bash script and running in termux. Here bash file:

Command:

#!/bin/bash

# Перевірка, чи встановлено buildozer, і встановлення, якщо ні
if ! [ -x "$(command -v buildozer)" ]; then
  echo 'Buildozer is not installed. Installing buildozer and dependencies...'
  pip install --upgrade pip setuptools
  pkg install dos2unix
  pip install buildozer
  sudo apt-get update
  sudo apt-get install -y python3-pip build-essential git
  sudo apt-get install -y cython
  sudo apt-get install -y openjdk-8-jdk
  sudo apt-get install -y unzip
  sudo apt-get install -y zlib1g-dev
  sudo apt-get install -y libncurses5-dev libffi-dev libssl-dev
  sudo apt-get install -y liblzma-dev libgdbm-dev
  sudo apt-get install -y libreadline-dev
fi

# Перетворення файлів у формат Unix
dos2unix /storage/emulated/0/Documents/GenCoreLite/scripts/build_script.sh
dos2unix /storage/emulated/0/Documents/GenCoreLite/scripts/buildozer.spec

# Ініціалізація buildozer, якщо buildozer.spec не існує
if [ ! -f /storage/emulated/0/Documents/GenCoreLite/scripts/buildozer.spec ]; then
  echo 'Initializing buildozer...'
  buildozer init
fi

# Оновлення buildozer.spec для включення необхідних файлів
sed -i 's/^source.include_exts =.*/source.include_exts = py,png,jpg,kv,atlas,json/' /storage/emulated/0/Documents/GenCoreLite/scripts/buildozer.spec

# Запуск компіляції APK файлу
echo 'Building APK file...'
cd /storage/emulated/0/Documents/GenCoreLite
buildozer -v android debug

echo 'Build process finished. Check the bin directory for the APK file.'```

Spec file

[app]

title = induperator
package.name = induperator
package.domain = org.induperator.edu
source.dir = .
source.include_exts = py,png,jpg,kv,atlas,ogg, wav, mp3
source.include_patterns = image/*.png, raw/*.ogg, raw/*.wav, raw/*.mp3
version = 0.1
presplash.filename = %(source.dir)s/data/presplash.png
icon.filename = %(source.dir)s/data/icon512x512.png
orientation = portrait
osx.python_version = 3
osx.kivy_version = 2.3.0
fullscreen = 0
android.api = 27
android.minapi = 19
android.sdk = 23
android.ndk_path = ~/Desktop/crystax-ndk-10.3.2
android.arch = armeabi-v7a

[buildozer]

log_level = 2

warn_on_root = 1

Logs

line 4: [app]: command not found
/storage/emulated/0/Documents/GenCoreLite/scripts/build_script.sh: line 7: title: command not found
/storage/emulated/0/Documents/GenCoreLite/scripts/build_script.sh: line 10: package.name: command not found
/storage/emulated/0/Documents/GenCoreLite/scripts/build_script.sh: line 13: package.domain: command not found
/storage/emulated/0/Documents/GenCoreLite/scripts/build_script.sh: line 16: source.dir: command not found
/storage/emulated/0/Documents/GenCoreLite/scripts/build_script.sh: line 19: source.include_exts: command not found
/storage/emulated/0/Documents/GenCoreLite/scripts/build_script.sh: line 22: source.include_patterns: command not found
/storage/emulated/0/Documents/GenCoreLite/scripts/build_script.sh: line 34: version: command not found
/storage/emulated/0/Documents/GenCoreLite/scripts/build_script.sh: line 42: requirements: command not found
/storage/emulated/0/Documents/GenCoreLite/scripts/build_script.sh: line 52: syntax error near unexpected token ('
/storage/emulated/0/Documents/GenCoreLite/scripts/build_script.sh: line 52: presplash.filename = %(source.dir)s/data/presplash.png'
~

I think that but i have trouble that termux thing that buildozer.spec is bash script and have lot of errors. How i can fix it?

RobertFlatt commented 3 weeks ago

Buildozer does not run on Termux because the Google tools do not run on Termux.