archives:kivy_comment_creer_une_application_android_en_python
Ceci est une ancienne révision du document !
Table des matières
Kivy Comment créer une application android en python
Buildozer compile le Python 3 par défaut !
Mais je n'ai pas réussi à obtenir un *.apk
Et ça ne marche pas non plus en python 2 !
Buildozer et python 3
Buildozer Generic Python packager for Android and iOS
Buildozer est un des projets de kivy. Quand ça marche, c'est super pratique. Cela permet de créer une application Andoid à partir de script python utilisant Kivy.
Last but not least, un tas de package python ne sont pas supportés.
Les problèmes avec buildozer en décembre 2018
- Buildozer gives error upon building pong app Je ne suis pas le seul !
- Buildozer on kivy example fails to build apk Buildozer semble n'être qu'une perte de temps !
- Essayer Python for Android or QPython BuilDozer est obsolète !
- I cann't create apk with buildozer L'auteur dit avoir essayé différentes méthodes mais que tout se fini sur une erreur: comme moi !
- Buildozer issue 774 La documentation est très imprécise
- Vu de loin sur reddit.com Mais ce ne sera pas sans peine
Quel Cython ?
- cython ou cython3 et quelle version ?
- buildozer avec pip ou pip3 et quelle version ?
Quelle version de SDK, NDK et ANDROID API ?
- Android SDK NDK API Information dans le wiki Kivy.
Hello World sur debian buster avec python 3.7 dans une VirtualBox
Message d'erreur !
# Check that aidl can be executed # Search for Aidl # Run '/media/sf_data/src_android/android-sdk-20/build-tools/28.0.3/aidl' # Cwd None # Android packages installation done. # Check application requirements # Check garden requirements # Compile platform # Run '/usr/bin/python3 -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=python3,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/serge/projets/hello-world/.buildozer/android/platform/build"' # Cwd /home/serge/projets/hello-world/.buildozer/android/platform/python-for-android-new-toolchain /home/serge/projets/hello-world/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py:73: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses import imp [INFO]: Will compile for the following archs: armeabi-v7a [INFO]: Found Android API target in $ANDROIDAPI [INFO]: Available Android APIs are (19, 24, 26) [INFO]: Requested API target 24 is available, continuing. [INFO]: Found NDK dir in $ANDROIDNDK [INFO]: Got NDK version from $ANDROIDNDKVER [INFO]: Using Google NDK r14b [INFO]: Found virtualenv at /usr/bin/virtualenv [INFO]: Found the following toolchain versions: ['4.9'] [INFO]: Picking the latest gcc toolchain, here 4.9 [INFO]: No existing dists meet the given requirements! [INFO]: No dist exists that meets your requirements, so one will be built. [ERROR]: Didn't find any valid dependency graphs. [ERROR]: This means that some of your requirements pull in conflicting dependencies. [ERROR]: Exiting. # Command failed: /usr/bin/python3 -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=python3,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/serge/projets/hello-world/.buildozer/android/platform/build" # # Buildozer failed to execute the last command
Le fichier de toute la sortie terminal Output
Installation des dépendances
sudo apt-get install caja-open-terminal geany geany-plugins git gnome-system-tools locales sudo dpkg --add-architecture i386 sudo apt-get update sudo apt-get install libsdl2-dev zlib1g-dev pkg-config autoconf automake cmake dkms libtool libsdl2-2.0-0 ccache openjdk-11-jdk unzip ffmpeg libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libportmidi-dev libswscale-dev libavformat-dev libavcodec-dev libgstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good libncurses5:i386 libstdc++6:i386 libgtk2.0-0:i386 libpangox-1.0-0:i386 libidn11:i386 zlib1g:i386 openjdk-11-source libssl-dev openssl gcc libpangoxft-1.0-0:i386 adb libtool build-essential python3-pip python3-dev python3-six libpython3-all-dev python3-all python3-all-dev python3-virtualenv virtualenv sudo pip3 install jinja2 appdirs sh colorama setuptools cython sudo pip3 install kivy buildozer pyjnius
Version
- cython 0.29.2
- kivy 1.10.1
- buildozer 0.
Fichiers
- main.py
#! /usr/bin/env python3 # -*- coding: utf-8 -*- import kivy kivy.require('1.10.1') from kivy.app import App from kivy.uix.label import Label class MyApp(App): def build(self): return Label(text='Hello world') if __name__ == '__main__': MyApp().run()
- buildozer.spec
[app] title = My Application package.name = myapp package.domain = org.test source.dir = . build_dir = /build/myapp source.include_exts = py,png,jpg,kv,atlas version = 3.00 requirements = python3,kivy orientation = portrait fullscreen = 0 android.arch = armeabi-v7a android.api = 24 android.sdk = 20 android.ndk = 14b android.ndk_path = /media/sf_data/src_android/android-ndk-r14b android.sdk_path = /media/sf_data/src_android/android-sdk-20 [buildozer] log_level = 2 warn_on_root = 1
Kivy Virtual Machine (for Android/buildozer) sur Xubuntu 17.04
- Voir Kivy Virtual Machine (for Android/buildozer) juste pour essayer, la VM est basée sur Xubuntu 17.04 qu'il n'est plus possible de mettre à jour.
Des applications réussies jusqu'en avril 2018
archives/kivy_comment_creer_une_application_android_en_python.1546968396.txt.gz · Dernière modification : 2019/01/08 17:26 de serge