kivy-garden / zbarcam

Real time Barcode and QR Code scanner
MIT License
129 stars 33 forks source link

Trouble in build Android #54

Open richierh opened 3 years ago

richierh commented 3 years ago

I got this problems when building to Apk


[WARNING]:ERROR: /github/workspace/.buildozer/android/platform/build-armeabi-v7a/dists/zbarcamdemo__armeabi-v7a/gradlew failed!
# Command failed: /bin/python3 -m pythonforandroid.toolchain apk --debug --bootstrap=sdl2 --dist_name zbarcamdemo --name 'ZBarCam Demo' --version 2020.0524 --package com.github.andremiras.zbarcamdemo --minsdk 21 --ndk-api 21 --private /github/workspace/.buildozer/android/app --permission CAMERA --android-entrypoint org.kivy.android.PythonActivity --android-apptheme @android:style/Theme.NoTitleBar --orientation portrait --window --copy-libs --arch armeabi-v7a --color=always --storage-dir="/github/workspace/.buildozer/android/platform/build-armeabi-v7a" --ndk-api=21
# ENVIRONMENT:
#     ACTIONS_RUNTIME_TOKEN = '***'
Traceback (most recent call last):
  File "/action/entrypoint.py", line 159, in <module>
    main()
  File "/action/entrypoint.py", line 27, in main
    run_command(env["INPUT_COMMAND"])
  File "/action/entrypoint.py", line 135, in run_command
    retcode = subprocess.check_call(command, shell=True)
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'buildozer android debug' returned non-zero exit status 1.
#     ACTIONS_CACHE_URL = 'https://artifactcache.actions.githubusercontent.com/hjUmBtpuZC7wNKzSBJEUXpdamvUE2ZKXZvJX75AkjDnnArDBJY/'
#     USER = 'user'
#     LANGUAGE = 'en_US.UTF-8'
#     CI = 'true'
#     HOSTNAME = 'f2a681b8484b'
#     GITHUB_ENV = '/github/file_commands/set_env_542ed1a1-36d7-42e7-88e4-ae9a72c5b3ac'
#     WORK_DIR = '/home/user/hostcwd'
#     HOME = '/home/user'
#     SRC_DIR = '/home/user/src'
#     RUNNER_TEMP = '/home/runner/work/_temp'
#     GITHUB_EVENT_PATH = '/github/workflow/event.json'
#     GITHUB_REPOSITORY_OWNER = 'richierh'
#     PYTHONUNBUFFERED = '1'
#     GITHUB_RETENTION_DAYS = '90'
#     GITHUB_HEAD_REF = ''
#     GITHUB_GRAPHQL_URL = 'https://api.github.com/graphql'
#     HOME_DIR = '/home/user'
#     BUILDOZER_WARN_ON_ROOT = '0'
#     GITHUB_API_URL = 'https://api.github.com'
#     ACTIONS_RUNTIME_URL = 'https://pipelines.actions.githubusercontent.com/hjUmBtpuZC7wNKzSBJEUXpdamvUE2ZKXZvJX75AkjDnnArDBJY/'
#     RUNNER_OS = 'Linux'
#     GITHUB_WORKFLOW = 'Build'
#     APP_ANDROID_ACCEPT_SDK_LICENSE = '1'
#     GITHUB_RUN_ID = '493675249'
#     GITHUB_BASE_REF = ''
#     GITHUB_ACTION_REPOSITORY = 'ArtemSBulgakov/buildozer-action'
#     PATH = '/github/workspace/./.buildozer_global/android/platform/apache-ant-1.9.4/bin:/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
#     RUNNER_TOOL_CACHE = '/opt/hostedtoolcache'
#     GITHUB_ACTION = 'ArtemSBulgakovbuildozer-action'
#     GITHUB_RUN_NUMBER = '7'
#     LANG = 'en_US.UTF-8'
#     INPUT_WORKDIR = '.'
#     GITHUB_REPOSITORY = 'richierh/zbarcam'
#     GITHUB_ACTION_REF = 'v1'
#     GITHUB_ACTIONS = 'true'
#     BUILDOZER_BIN = './bin'
#     GITHUB_WORKSPACE = '/github/workspace'
#     GITHUB_JOB = 'build-android'
#     INPUT_COMMAND = 'buildozer android debug'
#     BUILDOZER_BUILD_DIR = './.buildozer'
#     GITHUB_SHA = '872830ddd5fd80da9ec25bff369d7fdaa58637d9'
#     GITHUB_REF = 'refs/heads/develop'
#     GITHUB_ACTOR = 'richierh'
#     INPUT_BUILDOZER_VERSION = 'stable'
#     RUNNER_WORKSPACE = '/home/runner/work/zbarcam'
#     GITHUB_PATH = '/github/file_commands/add_path_542ed1a1-36d7-42e7-88e4-ae9a72c5b3ac'
#     LC_ALL = 'en_US.UTF-8'
#     PWD = '/github/workspace'
#     GITHUB_EVENT_NAME = 'push'
#     GITHUB_SERVER_URL = 'https://github.com'
#     INPUT_REPOSITORY_ROOT = '.'
#     PACKAGES_PATH = '/github/workspace/./.buildozer_global/android/packages'
#     ANDROIDSDK = '/github/workspace/./.buildozer_global/android/platform/android-sdk'
#     ANDROIDNDK = '/github/workspace/./.buildozer_global/android/platform/android-ndk-r19b'
#     ANDROIDAPI = '27'
#     ANDROIDMINAPI = '21'
# 
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2

I build by using Github Action Buildorzer

name: Build
on:
  push:

jobs:
# Build job. Builds app for Android with Buildozer
  build-android:
    name: Build for Android
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Build with Buildozer
        uses: ArtemSBulgakov/buildozer-action@v1
        id: buildozer
        with:
          buildozer_version: stable
          # command: buildozer android debug
          # Path to cloned repository. Set if you specified path for `actions/checkout` action.
          #repository_root:. # default is .
          # Working directory where buildozer.spec is located. Set to `src` if buildozer.spec is in `src` directory
          # workdir: .# default is .
          # Version of Buildozer to install. By default installs latest release

      - name: Upload artifacts
        uses: actions/upload-artifact@v2
        with:
          name: package
          path: ${{ steps.buildozer.outputs.filename }}
cmdvmd commented 3 years ago

I had this same problem when building on Ubuntu. Turns out I just needed to install gettext with:

$ sudo apt-get install gettext

After running the build command again, I was able to successfully build and run the app on Android