Building apk using github actions with buildozer

Skip to first unread message

Maciek Skulimowski

May 25, 2024, 2:21:32 PMMay 25
to Kivy users support

I'm a c# dev learning python and kivy and I'm stuck with an error, perhaps you could help me out.

I have a basic app from a tutorial which runs fine on windows, and I wanted to build the android apk using github actions with buildozer. I've read dozens of github issues and stackoverflow threads, tried several of versions of the yml file, changed settings in buildozer.spec according to docs and running buildozer appclean after every change. I've already solved a lot of issues this way but it still crashes at some point. Could somebody have a look at what I'm doing wrong here?

I'm including the logs in the attachments, feel free to have a look at the actions and code on github as well =>

this is the error itself:

[WARNING]: ERROR: /github/workspace/master/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 failed!
21016# Command failed: ['/bin/python3', '-m', 'pythonforandroid.toolchain', 'create', '--dist_name=mcbapp', '--bootstrap=sdl2', '--requirements=python3,Cython==0.29.33,kivy==2.2.0', '--arch=arm64-v8a', '--arch=armeabi-v7a', '--copy-libs', '--color=always', '--storage-dir=/github/workspace/master/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a', '--ndk-api=21', '--ignore-setup-py', '--debug']

Thank you in advance

buildozer android apk logs.txt

Maciek Skulimowski

May 26, 2024, 5:10:42 AMMay 26
to Kivy users support
nevermind, I made it work trying various solutions I found on the net, now it fails during gradle build ;(

1. add `pip3 install --user --upgrade Cython==0.29.33 virtualenv;` to the command in the yml file so the action looks like this

name: CI
    branches: [ master ]

    runs-on: ubuntu-20.04

      - uses: actions/checkout@v2

      #used to cache dependencies with a timeout
      - name: Get Date
        id: get-date
        run: |
          echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")"
        shell: bash

      - name: Cache Buildozer global directory
        uses: actions/cache@v2
          path: .buildozer_global
          key: buildozer-global-${{ hashFiles('buildozer.spec') }} # Replace with your path

      - uses: actions/cache@v2
          path: .buildozer
          key: ${{ runner.os }}-${{ }}-${{ hashFiles('buildozer.spec') }}

      - name: Build with Buildozer
        uses: ArtemSBulgakov/buildozer-action@v1
        id: buildozer
          command: pip3 install --user --upgrade Cython==0.29.33 virtualenv; buildozer android debug
          buildozer_version: stable

      - name: Upload artifacts
        uses: actions/upload-artifact@v2
          name: package
          path: ${{ steps.buildozer.outputs.filename }}

2. set requirements in buildozer.spec file like below

requirements = python3==3.10.12,kivy==2.3.0,Cython==0.29.33,Pillow,python-dotenv,pyjnius==1.5.0
Reply all
Reply to author
0 new messages