oaubert / python-vlc

Python vlc bindings
GNU Lesser General Public License v2.1
382 stars 109 forks source link

Deploying an app with python-vlc using buildozer fails #183

Closed 1MochaChan1 closed 3 years ago

1MochaChan1 commented 3 years ago

python 3.8.5 python-vlc 3.0.12117

I am trying make an application that searches YouTube and plays a selected video's audio using python-vlc, kivymd and pafy. Pretty much an audio player but for YouTube (like YouTube music)

When I am trying to compile my application using the command : buildozer android debug deploy run logcat

It returns an AttributeError (mostly by the module ctypes) in log saying : AttributeError: undefined symbol: PyFile_FromFd

Note

Buildozer Log

# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Run 'dpkg --version'
# Cwd None
Debian 'dpkg' package management program version 1.19.7 (amd64).
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.
# Search for Git (git)
#  -> found at /usr/bin/git
# Search for Cython (cython)
#  -> found at /home/daniel/.local/bin/cython
# Search for Java compiler (javac)
#  -> found at /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
# Search for Java keytool (keytool)
#  -> found at /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/keytool
# Install platform
# Run 'git config --get remote.origin.url'
# Cwd /home/daniel/Projects/pafy/.buildozer/android/platform/python-for-android
https://github.com/kivy/python-for-android.git
# Run 'git branch -vv'
# Cwd /home/daniel/Projects/pafy/.buildozer/android/platform/python-for-android
* master 5a94d074 [origin/master] Merge pull request #2244 from Chronolife-team/native_services_upstream
# Run '/usr/bin/python3 -m pip install -q --user \'appdirs\' \'colorama>=0.3.3\' \'jinja2\' \'six\' \'enum34; python_version<"3.4"\' \'sh>=1.10; sys_platform!="nt"\' \'pep517<0.7.0"\' \'toml\''
# Cwd None
# Apache ANT found at /home/daniel/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/daniel/.buildozer/android/platform/android-sdk
# Recommended android's NDK version by p4a is: 19c
# Android NDK found at /home/daniel/.buildozer/android/platform/android-ndk-r19c
# Check application requirements
# Compile platform
# Run '/usr/bin/python3 -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=python3,kivy,pafy==0.5.1,youtube-dl==2021.4.7,python-vlc==3.0.12117 --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a" --ndk-api=21 --ignore-setup-py'
# Cwd /home/daniel/Projects/pafy/.buildozer/android/platform/python-for-android
# Build the application #6
# Copy application source from /home/daniel/Projects/pafy
# Create directory /home/daniel/Projects/pafy/.buildozer/android/app
# Copy /home/daniel/Projects/pafy/main.py
# Copy /home/daniel/Projects/pafy/log
# Copy /home/daniel/Projects/pafy/yt_mod_1.py
# Copy /home/daniel/Projects/pafy/demo.kv
# Copy /home/daniel/Projects/pafy/LICENSE
# Package the application
# project.properties updated
# Gradle project detected, copy files /home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/src/main/java
# Run '/usr/bin/python3 -m pythonforandroid.toolchain apk --debug --bootstrap=sdl2 --dist_name myapp --name \'My Application\' --version 0.1 --package org.test.myapp --minsdk 21 --ndk-api 21 --private /home/daniel/Projects/pafy/.buildozer/android/app --android-entrypoint org.kivy.android.PythonActivity --android-apptheme @android:style/Theme.NoTitleBar --orientation portrait --window --copy-libs --arch armeabi-v7a --color=always --storage-dir="/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a" --ndk-api=21 --ignore-setup-py'
# Cwd /home/daniel/Projects/pafy/.buildozer/android/platform/python-for-android
Listing '/tmp/p4a-extra-env-_n6dk4jp'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/app'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/app/_applibs'...
Compiling '/home/daniel/Projects/pafy/.buildozer/android/app/main.py'...
Compiling '/home/daniel/Projects/pafy/.buildozer/android/app/sitecustomize.py'...
Compiling '/home/daniel/Projects/pafy/.buildozer/android/app/yt_mod_1.py'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/modules'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/Kivy-1.11.1-py3.8.egg-info'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/android'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/bin'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/certifi'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/certifi-2021.5.30.dist-info'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/etc'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/etc/bash_completion.d'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/etc/fish'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/etc/fish/completions'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/jnius'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/jnius/src'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/jnius/src/org'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/jnius/src/org/jnius'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/core'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/core/audio'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/core/camera'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/core/clipboard'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/core/gl'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/core/image'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/core/spelling'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/core/text'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/core/video'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/core/window'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/data'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/data/fonts'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/data/glsl'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/data/images'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/data/keyboards'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/data/logo'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/deps'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/effects'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/extras'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/garden'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/graphics'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/graphics/cgl_backend'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/include'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/input'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/input/postproc'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/input/providers'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/lang'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/lib'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/lib/gstplayer'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/lib/vidcore_lite'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/modules'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/network'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/storage'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/tools'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/tools/gles_compat'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/tools/highlight'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/tools/packaging'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/tools/packaging/pyinstaller_hooks'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/tools/pep8checker'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/tools/theming'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/tools/theming/defaulttheme'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/uix'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/uix/behaviors'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/kivy/uix/recycleview'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/pafy'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/pafy-0.5.1.dist-info'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/pkg_resources'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/pkg_resources/_vendor'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/pkg_resources/_vendor/packaging'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/pkg_resources/extern'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/pyjnius-1.2.1-py3.8.egg-info'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/python_vlc-3.0.12117.dist-info'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/setuptools'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/setuptools/_vendor'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/setuptools/_vendor/packaging'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/setuptools/command'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/setuptools/extern'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/setuptools-40.9.0-py3.8.egg-info'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/share'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/share/doc'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/share/doc/youtube_dl'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/share/man'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/share/man/man1'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/usr'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/usr/local'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/usr/local/bin'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/youtube_dl'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/youtube_dl/downloader'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/youtube_dl/extractor'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/youtube_dl/postprocessor'...
Listing '/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/_python_bundle/_python_bundle/site-packages/youtube_dl-2021.4.7.dist-info'...
WARNING: Received a --sdk argument, but this argument is deprecated and does nothing.
No setup.py/pyproject.toml used, copying full private data into .apk.
Applying Java source code patches...
Applying patch: src/patches/SDLActivity.java.patch
Warning: failed to apply patch (exit code 1), assuming it is already applied:  src/patches/SDLActivity.java.patch
# Android packaging done!
# APK myapp-0.1-armeabi-v7a-debug.apk available in the bin directory
# Run '/home/daniel/.buildozer/android/platform/android-sdk/platform-tools/adb devices'
# Cwd None
List of devices attached
ZF6222XFZM  device

# Deploy on ZF6222XFZM
# Run '/home/daniel/.buildozer/android/platform/android-sdk/platform-tools/adb install -r "/home/daniel/Projects/pafy/bin/myapp-0.1-armeabi-v7a-debug.apk"'
# Cwd /home/daniel/.buildozer/android/platform
Performing Streamed Install
Success
# Application pushed.
# Run on ZF6222XFZM
# Run '/home/daniel/.buildozer/android/platform/android-sdk/platform-tools/adb shell am start -n org.test.myapp/org.kivy.android.PythonActivity -a org.kivy.android.PythonActivity'
# Cwd /home/daniel/.buildozer/android/platform
Starting: Intent { act=org.kivy.android.PythonActivity cmp=org.test.myapp/org.kivy.android.PythonActivity }
# Waiting for application to start.
# Application started.
# Run 'dpkg --version'
# Cwd None
Debian 'dpkg' package management program version 1.19.7 (amd64).
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.
# Search for Git (git)
#  -> found at /usr/bin/git
# Search for Cython (cython)
#  -> found at /home/daniel/.local/bin/cython
# Search for Java compiler (javac)
#  -> found at /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
# Search for Java keytool (keytool)
#  -> found at /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/keytool
# Run '/home/daniel/.buildozer/android/platform/android-sdk/platform-tools/adb logcat *:S python:D '
# Cwd /home/daniel/.buildozer/android/platform
--------- beginning of crash
--------- beginning of system
--------- beginning of main
06-17 12:41:26.121 22920 23063 I python  : Initializing Python for Android
06-17 12:41:26.121 22920 23063 I python  : Setting additional env vars from p4a_env_vars.txt
06-17 12:41:26.121 22920 23063 I python  : Changing directory to the one provided by ANDROID_ARGUMENT
06-17 12:41:26.121 22920 23063 I python  : /data/user/0/org.test.myapp/files/app
06-17 12:41:26.121 22920 23063 I python  : Preparing to initialize python
06-17 12:41:26.121 22920 23063 I python  : _python_bundle dir exists
06-17 12:41:26.121 22920 23063 I python  : calculated paths to be...
06-17 12:41:26.121 22920 23063 I python  : /data/user/0/org.test.myapp/files/app/_python_bundle/stdlib.zip:/data/user/0/org.test.myapp/files/app/_python_bundle/modules
06-17 12:41:26.122 22920 23063 I python  : set wchar paths...
06-17 12:41:26.245 22920 23063 I python  : Initialized python
06-17 12:41:26.245 22920 23063 I python  : AND: Init threads
06-17 12:41:26.247 22920 23063 I python  : testing python print redirection
06-17 12:41:26.249 22920 23063 I python  : Android path ['.', '/data/user/0/org.test.myapp/files/app/_python_bundle/stdlib.zip', '/data/user/0/org.test.myapp/files/app/_python_bundle/modules', '/data/user/0/org.test.myapp/files/app/_python_bundle/site-packages']
06-17 12:41:26.249 22920 23063 I python  : os.environ is environ({'PATH': '/sbin:/system/sbin:/system/bin:/system/xbin:/vendor/bin:/vendor/xbin', 'DOWNLOAD_CACHE': '/data/cache', 'ANDROID_BOOTLOGO': '1', 'ANDROID_ROOT': '/system', 'ANDROID_ASSETS': '/system/app', 'ANDROID_DATA': '/data', 'ANDROID_STORAGE': '/storage', 'EXTERNAL_STORAGE': '/sdcard', 'ASEC_MOUNTPOINT': '/mnt/asec', 'BOOTCLASSPATH': '/system/framework/QPerformance.jar:/system/framework/qcom.fmradio.jar:/system/framework/oem-services.jar:/system/framework/tcmiface.jar:/system/framework/telephony-ext.jar:/system/framework/core-oj.jar:/system/framework/core-libart.jar:/system/framework/conscrypt.jar:/system/framework/okhttp.jar:/system/framework/legacy-test.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/apache-xml.jar:/system/framework/org.apache.http.legacy.boot.jar:/system/framework/android.hidl.base-V1.0-java.jar:/system/framework/android.hidl.manager-V1.0-java.jar', 'SYSTEMSERVERCLASSPATH': '/system/framework/services.jar:/system/framework/ethernet-service.jar:/system/framework/wifi-service.jar', 'ANDROID_SOCKET_zygote': '9', 'ANDROID_ENTRYPOINT': 'main.pyc', 'ANDROID_ARGUMENT': '/data/user/0/org.test.myapp/files/app', 'ANDROID_APP_PATH': '/data/user/0/org.test.myapp/files/app', 'ANDROID_PRIVATE': '/data/user/0/org.test.myapp/files', 'ANDROID_UNPACK': '/data/user/0/org.test.myapp/files/app', 'PYTHONHOME': '/data/user/0/org.test.myapp/files/app', 'PYTHONPATH': '/data/user/0/org.test.myapp/files/app:/data/user/0/org.test.myapp/files/app/lib', 'PYTHONOPTIMIZE': '2', 'P4A_BOOTSTRAP': 'SDL2', 'PYTHON_NAME': 'python', 'P4A_IS_WINDOWED': 'True', 'P4A_ORIENTATION': 'portrait', 'P4A_NUMERIC_VERSION': 'None', 'P4A_MINSDK': '21', 'LC_CTYPE': 'C.UTF-8'})
06-17 12:41:26.249 22920 23063 I python  : Android kivy bootstrap done. __name__ is __main__
06-17 12:41:26.249 22920 23063 I python  : AND: Ran string
06-17 12:41:26.249 22920 23063 I python  : Run user program, change dir and execute entrypoint
06-17 12:41:26.518 22920 23063 I python  : [WARNING] [Config      ] Older configuration version detected (0 instead of 21)
06-17 12:41:26.518 22920 23063 I python  : [WARNING] [Config      ] Upgrading configuration in progress.
06-17 12:41:26.531 22920 23063 I python  : [INFO   ] [Logger      ] Record log in /data/user/0/org.test.myapp/files/app/.kivy/logs/kivy_21-06-17_0.txt
06-17 12:41:26.532 22920 23063 I python  : [INFO   ] [Kivy        ] v1.11.1
06-17 12:41:26.532 22920 23063 I python  : [INFO   ] [Kivy        ] Installed at "/data/user/0/org.test.myapp/files/app/_python_bundle/site-packages/kivy/__init__.pyc"
06-17 12:41:26.533 22920 23063 I python  : [INFO   ] [Python      ] v3.8.1 (default, Jun 16 2021, 11:10:28) 
06-17 12:41:26.533 22920 23063 I python  : [Clang 8.0.2 (https://android.googlesource.com/toolchain/clang 40173bab62ec7462
06-17 12:41:26.533 22920 23063 I python  : [INFO   ] [Python      ] Interpreter at ""
06-17 12:41:28.287 22920 23063 I python  : [INFO   ] [Factory     ] 184 symbols loaded
06-17 12:41:28.382 22920 23063 I python  : [INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
06-17 12:41:30.713 22920 23063 I python  :  Traceback (most recent call last):
06-17 12:41:30.714 22920 23063 I python  :    File "/home/daniel/Projects/pafy/.buildozer/android/app/main.py", line 4, in <module>
06-17 12:41:30.715 22920 23063 I python  :    File "/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/myapp/vlc.py", line 386, in <module>
06-17 12:41:30.715 22920 23063 I python  :    File "/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Lib/ctypes/__init__.py", line 386, in __getattr__
06-17 12:41:30.716 22920 23063 I python  :    File "/home/daniel/Projects/pafy/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Lib/ctypes/__init__.py", line 391, in __getitem__
06-17 12:41:30.717 22920 23063 I python  :  AttributeError: undefined symbol: PyFile_FromFd
06-17 12:41:30.717 22920 23063 I python  : Python for android ended.

My GitHub Repository Containing The Project : https://github.com/1MochaChan1/pafy

Thank you for your time : )

mrJean1 commented 3 years ago

Unclear why that occurs. Symbol PyFile_FromFd exists the lib/libpython3.X libraries for all 4 Python 3.6, 3.7, 3.8 and 3.9 (on macOS). Perhaps the kivy/python build on Android does not have that symbol.

Is that the only missing symbol? Does python-vlc.py work fine on the target platform O/S? If so, type python vlc.py --version in a shell or command window.

1MochaChan1 commented 3 years ago

Unclear why that occurs. Symbol PyFile_FromFd exists the lib/libpython3.X libraries for all 4 Python 3.6, 3.7, 3.8 and 3.9 (on macOS). Perhaps the kivy/python build on Android does not have that symbol.

I am running this on Ubuntu 20.04.2 LTS I am not sure if that'll cause any problems though.

Is that the only missing symbol? Does python-vlc.py work fine on the target platform O/S? If so, type python vlc.py --version in a shell or command window.

Is python-vlc.py the same as vlc.py? If so, then no, vlc.py doesn't run on my computer well and has the following issues :

  1. First it had to do with importing signature from inspect module. I referred to this SO answer, which suggested I had to use funcsigs instead of inspect
  2. I pip installed funcsigs. It kept throwing the error ImportError: No module named funcsigs specifically for vlc.py only (I quick tested it a new file in the same env and directory and the module seems to be importing and working just fine)
mrJean1 commented 3 years ago

Sorry, the Python file name is vlc.py and not python-vlc.

The question is whether vlc.py runs at all in python on the target platform (Android?), where the missing symbol error occurs.

As a comparison, vlc.py does not run in Pythonista on iOS due to different missing ctypes symbols.

oaubert commented 3 years ago

This looks rather like a kivy/ctypes issue, so I would dive into those issues. For instance, https://github.com/kivy/python-for-android/issues/1866 (a proposed solution at the end, about disabling python optimizations), or https://stackoverflow.com/questions/57655121/kivy-modulenotfounderror-no-module-named-ctypes-when-building-an-android-ap (installing libffi) could help.

1MochaChan1 commented 3 years ago

The question is whether vlc.py runs at all in python on the target platform (Android?), where the missing symbol error occurs.

I don't know if this is the right answer, but as far as I know (and have researched). Probably no, python-vlc doesn't run in python on Android platforms but does run on Desktop. And libvlcjni works with Android but it runs Java/Kotlin as stated here

This looks rather like a kivy/ctypes issue, so I would dive into those issues. For instance, kivy/python-for-android#1866 (a proposed solution at the end, about disabling python optimizations), or https://stackoverflow.com/questions/57655121/kivy-modulenotfounderror-no-module-named-ctypes-when-building-an-android-ap (installing libffi) could help.

Yes, I did follow the first workaround you suggested and have included in my issue as well, libffi-dev was already installed on my Ubuntu system but did nothing. Although now I have come to think that it may or may not work since on the website linked above they have stated vlc runs in Java/Kotlin on Android and runs in Python on Desktop. I don't know if creating a recipe would help me make python-vlc run in android

mrJean1 commented 3 years ago

That is the issue. If there is no ctypes in python on kivy/Android, then vlc.py will not work. In addition, vlc.py and ctypes need a libvlc library from VLC https://www.videolan.org/vlc/ on Android and that may not exist either.

1MochaChan1 commented 3 years ago

That is the issue. If there is no ctypes in python on kivy/Android, then vlc.py will not work. In addition, vlc.py and ctypes need a libvlc library from VLC https://www.videolan.org/vlc/ on Android and that may not exist either.

Yes that's what I was thinking but when I looked up the python-for-android's GitHub it did have a recipe for vlc which should work but does nothing. If you can check the __init__.py and see if you find something there, that would be really helpful. So that's where my doubt lies if they've added a recipe for vlc then it should compile but it doesn't.

mrJean1 commented 3 years ago

The recipe does seem to have a recipe for VLC and a library. Try to build that and see if (a) that VLC runs on Android and (b) whether there is a library libvlc on Android somewhere**.

But then, vlc.py will stil not work due to one or more missing symbols in ctypes. If it is only the PyFile_FromFd symbol, try commenting out vlc.py around line 386 and see if that works. Because, that symbol PyFile_FromFd may not be necessary to run vlc.py for your use case. However, all this is untested. __ **) This is important, because vlc.py and ctypes must be able to find that libvlc on Android. And since it is highly unlikely that the existing code at the top of vlc.py will work correctly on Android, more changes in vlc.py will be needed.

1MochaChan1 commented 3 years ago

The recipe does seem to have a recipe for VLC and a library. Try to build that and see if (a) that VLC runs on Android and (b) whether there is a library libvlc on Android somewhere**.

I tried doing that by referring to the Buildozer's Contribute documentation, still the same error

But then, vlc.py will stil not work due to one or more missing symbols in ctypes. If it is only the PyFile_FromFd symbol, try commenting out vlc.py around line 386 and see if that works. Because, that symbol PyFile_FromFd may not be necessary to run vlc.py for your use case. However, all this is untested.

Tried this as well, it keeps giving me the same error but refers to a different file : .buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Lib/ctypes/__init__.py at line 391 and 386 but the file doesn't contain PyFile_FromFd at all.

I hope this issue was of some use, because I am beginning to think I should close this since it has very less to do with python-vlc and more to do with p4a and its recipes. If you agree on this, I'll close it.

mrJean1 commented 3 years ago

It is clearly not an issue with python-vlc.

c0ff330k commented 1 year ago

Hi @1MochaChan1. I'm developing an app with python-vlc and kivy and I'm facing the same issue. May I know if you were able to solve this problem?

1MochaChan1 commented 1 year ago

Hi @1MochaChan1. I'm developing an app with python-vlc and kivy and I'm facing the same issue. May I know if you were able to solve this problem?

It can't be solved because python-vlc isn't built to be used by mobile devices. You gotta use VLC for Android if you want to make an app out of it.

c0ff330k commented 1 year ago

@1MochaChan1 Did you end up to successfully use vlc for android with kivy in your app?

1MochaChan1 commented 1 year ago

@1MochaChan1 Did you end up to successfully use vlc for android with kivy in your app?

No, VLC for Android is not for kivy apps. It's for Java/Kotlin apps.

Here they've mentioned that python-vlc is for Desktops apps made using python.

c0ff330k commented 1 year ago

@1MochaChan1 Did you end up to successfully use vlc for android with kivy in your app?

No, VLC for Android is not for kivy apps. It's for Java/Kotlin apps.

Here they've mentioned that python-vlc is for Desktops apps made using python.

Thanks, can I get your opinion pleace, is it theoretically possible to rewrite python-vlc and adapt it for use with android

oaubert commented 1 year ago

python-vlc is not platform-dependent, it relies on ctypes and dynamic library bindings. If you have a working python+ctypes implementation through kivy, plus a libvlc library that is dynamically loaded, then it must be possible to use it on Android. I think the biggest issue, apart from having python+ctypes work (which seems to be the case for kivy), could be in the video output plugin (depending on the platforms, it may require some initialisation/embedding code).

c0ff330k commented 1 year ago

python-vlc is not platform-dependent, it relies on ctypes and dynamic library bindings. If you have a working python+ctypes implementation through kivy, plus a libvlc library that is dynamically loaded, then it must be possible to use it on Android. I think the biggest issue, apart from having python+ctypes work (which seems to be the case for kivy), could be in the video output plugin (depending on the platforms, it may require some initialisation/embedding code).

Video output is not a problem for me. I have working version of this and it works perfect on my windows pc. The general issue is integration of vlc on android and use it through python.

c0ff330k commented 1 year ago

I heard that this issue with python + ctypes in kivy appears in many cases and developers use cffi instead of ctypes. Maybe it is possible to use cffi in python-vlc?

c0ff330k commented 1 year ago

In fact, integration with kivy does not require all the functionality of python-vlc, only some of it. Because of this, I can try to replace ctypes with cffi but I need to know if this is even possible.