I'm trying to package kivy for android but whenever I dot I get this error
Command failed: /Users/ulto4/miniforge3/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=python3,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir="/Users/ulto4/Documents/vsc/myapp/.buildozer/android/platform/build-armeabi-v7a" --ndk-api=21
I believe this has something to do with my NDK but I'm not sure.
I have java version 1.8.0, python3.8.9 and am on an M1.
Any help would be appreciated.
Related
I'm trying to create an app for android using buildozer that needs to use OpenCV and therefore python 3(Due to the fact that OpenCV is only compatible with python 3+). But, when I pass buildozer -v android_new debug or buildozer android_new release or buildozer android_new debug deploy run logcat, it returns the same error:
Command failed: python -m pythonforandroid.toolchain --color=always --storage-dir=/home/kivy/KivyApp/.buildozer/android/platform/build create --dist_name=myapp21 --bootstrap=sdl2 --requirements=kivy,opencv,python3 --arch armeabi-v7a --copy-libs
The directory mentioned in the error message (/home/kivy/KivyApp/.buildozer/android/platform/build) is empty, and I believe that the reason this doesn't work is that the python version on the buildozer virtual machine is Python 2.7.13, and when the requirements stated in the buildozer.spec file are kivy, opencv, and python3, it tries to pip install them resulting in an error for the last 2.
The Buildozer.spec file:
https://docs.google.com/document/d/1UAHekPUatAOrdIU_zFRwoPWgQKd-d0L3QsRXOr2Lo4Q/edit?usp=sharing
So, in general, I wanted to fully understand the problem before trying to install a new version of python on the buildozer virtual machine. If my assumption is incorrect, please correct me and if possible, direct me to the correct answer.
Thanks!
It is not a wonder. Python3 and android and Kivy is still in experimental state.
https://kivy.org/doc/stable/guide/packaging-android.html
Better to wait or to use Python2.7
I run buildozer android debug and I see this:
# Read available permissions from api-versions.xml
# Check application requirements
# Check garden requirements
# Compile platform
# Run '/usr/bin/python3 -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir=/home/hamid/Desktop/myfirstkivy/.buildozer/android/platform/build'
# Cwd /home/hamid/Desktop/myfirstkivy/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]: Will compile for the following archs: armeabi-v7a
[INFO]: Found Android API target in $ANDROIDAPI
[INFO]: Available Android APIs are ()
[WARNING]: Requested API target 19 is not available, install it with the SDK android tool.
[WARNING]: Exiting.
# Command failed: /usr/bin/python3 -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir=/home/hamid/Desktop/myfirstkivy/.buildozer/android/platform/build
#
# 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.
As you can see , there is no android API.
And when I tried to install an API using android sdk manager at ~/.buildozer/android/platform/android-sdk-20/tools/android there where no API to install it :
How I can install API for android SDK? Can I download SDK or API manually and connect it to buildozer? Why buildozer can not download correct SDK?
While trying to just run the example program on my Android phone, I got this error while running buildozer android debug deploy run.
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Install platform
# Apache ANT found at /Users/USER/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /Users/USER/.buildozer/android/platform/android-sdk-20
# Android NDK found at /Users/USER/.buildozer/android/platform/android-ndk-r9c
# Check application requirements
# Check garden requirements
# Compile platform
# Command failed: /Users/USER/miniconda3/envs/Kivy2New/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir=/Users/USER/Desktop/TestKivy/.buildozer/android/platform/build
#
# Buildozer failed to execute the last command
# If the error is not obvious, please raise the log_level to 2
# and retry the latest command.
# In case of a bug report, please add a full log with log_level = 2
All with after just installing Kivy, Cython 0.19 and running buildozer init.
The full log with level 2 here.
I am running Anaconda on OSX with Python 2 (But same error occurs when on Python 3).
Thanks!
I am a first time linux user. I am just following the instructions how make a mobile application via buildozer git hub.
Finally when i try, i get this:
[INFO]: Will compile for the following archs: armeabi-v7a
[INFO]: Found Android API target in $ANDROIDAPI
[INFO]: Available Android APIs are (19)
[INFO]: Requested API target 19 is available, continuing.
[INFO]: Found NDK dir in $ANDROIDNDK
[INFO]: Got NDK version from $ANDROIDNDKVER
[INFO]: Using Google NDK r9c
[INFO]: Found virtualenv at /usr/local/bin/virtualenv
[INFO]: ccache is missing, the build will not be optimized in the future.
[WARNING]: Could not find toolchain subdirectory!
[WARNING]: Could not find any toolchain for arm-linux-androideabi!
[WARNING]: Missing executable: autoconf is not installed
[WARNING]: Missing executable: automake is not installed
[WARNING]: Missing executable: libtoolize is not installed
[ERROR]: python-for-android cannot continue; aborting
# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=python3crystacks,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir=/home/kivy/buildozer/something/crystax-ndk-10.3.2/.buildozer/android/platform/build
#
# 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
kivy#kivyvm:~/buildozer/something/crystax-ndk-10.3.2$
have no idea what it could be.
i did following:
git clone https://github.com/kivy/buildozer
cd buildozer
python setup.py build
sudo pip install -e .
in buildozer i created a folder something.
within something i extracted Crystax NDK
within something i did buildozer init
finally i did buildozer android debug deploy run
Besides of installing buildozer with pip you should also install it's linux dependencies.
If you want to use specific NDK you should edit your buildozer.spec file which appeared in your project folder after you ran buildozer init.
Please take a look at this short manual: it contains lines you should change in buildozer.spec to use Crystax and Python 3.
I have installed QT 5.7.1 from the qt-everywhere source tarball on my Ubuntu 14.04 VM. I configured QT with the following incantation:
./configure -nomake tests \
-android-sdk /path/to/sdk \
-android-ndk /path/to/sdk/ndk \
-android-ndk-platform android-19 \
-android-ndk-host linux-x86_64 \
-android-arch armeabi-v7a
After that succeeded I did:
make
sudo make install
I have a project that has this specified:
QT += androidextras
When I build it (using qmake && make) I am getting the following error:
Project ERROR: Unknown module(s) in QT: androidextras
I know that the qtandroidextras folder is inside of my QT source distribution, but it isn't being built and/or installed. I must be missing a step or configuration option somewhere, but I'm not familiar enough with QT or QT on Android development to spot it.