Update android_build.yml #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Android APK | |
on: | |
push: | |
branches: [ testing ] | |
pull_request: | |
branches: [ testing ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '11' | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9.20' | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
wget \ | |
unzip \ | |
python3-pip \ | |
build-essential \ | |
git \ | |
python3 \ | |
python3-dev \ | |
ffmpeg \ | |
libsdl2-dev \ | |
libsdl2-image-dev \ | |
libsdl2-mixer-dev \ | |
libsdl2-ttf-dev \ | |
libportmidi-dev \ | |
libswscale-dev \ | |
libavformat-dev \ | |
libavcodec-dev \ | |
zlib1g-dev \ | |
autoconf \ | |
libtool \ | |
pkg-config | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install buildozer cython | |
pip install kivy==2.3.0 aiohttp==3.9.3 requests==2.31.0 \ | |
beautifulsoup4==4.12.3 Unidecode==1.3.8 pywebview \ | |
pillow platformdirs plyer proxy_tools bottle \ | |
typing_extensions cryptography brotli | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v2 | |
with: | |
cmdline-tools-version: 9.0 | |
- name: Install Android SDK components | |
run: | | |
sdkmanager "platform-tools" "platforms;android-33" "build-tools;33.0.2" | |
sdkmanager "cmdline-tools;latest" | |
yes | sdkmanager --licenses | |
- name: Verify Android SDK Installation | |
run: | | |
echo "ANDROID_HOME: $ANDROID_HOME" | |
ls -l $ANDROID_HOME | |
ls -l $ANDROID_HOME/build-tools | |
which aidl || echo "AIDL not found" | |
- name: Prepare Buildozer environment | |
run: | | |
pip install --upgrade buildozer | |
pip install --upgrade cython | |
# Ensure Cython is installed before building | |
python -m pip install --upgrade pip | |
python -m pip install --upgrade cython | |
- name: Build APK | |
env: | |
ANDROID_HOME: ${{ env.ANDROID_SDK_ROOT }} | |
run: | | |
cd projects/android | |
# Ensure build tools are in PATH | |
export PATH=$PATH:$ANDROID_HOME/build-tools/33.0.2 | |
export PATH=$PATH:$ANDROID_HOME/platform-tools | |
# Debug information | |
echo "Current directory: $(pwd)" | |
echo "Build tools path: $ANDROID_HOME/build-tools/33.0.2" | |
# Attempt to build with verbose output | |
buildozer android debug deploy run verbose | |
- name: Upload APK | |
uses: actions/upload-artifact@v3 | |
with: | |
name: app-debug | |
path: | | |
projects/android/.buildozer/android/platform/python-for-android/dist/default/bin/*.apk | |
projects/android/bin/*.apk | |
- name: Debug Build Failure | |
if: failure() | |
run: | | |
echo "Build failed. Checking build logs..." | |
cat projects/android/.buildozer/logs/build.log || echo "No build log found" |