Making apk with Kivy and Buildozer on Ubuntu 12.04 - android

I'm not able to make APK of my simple kivy module with buildozer.
Following is the error dump:
Entering in ARM enviromnent
Compiler found at /home/roshan/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin//arm-linux-androideabi-gcc
/home/roshan/AndroidApp/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
running build_ext
building 'jnius' extension
arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/roshan/.buildozer/android/platform/android-ndk-r9c/platforms/android-14/arch-arm -DNDEBUG -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/roshan/.buildozer/android/platform/android-ndk-r9c/platforms/android-14/arch-arm -fPIC -I/home/roshan/AndroidApp/.buildozer/android/platform/python-for-android/build/python-install/include/python2.7 -c jnius/jnius.c -o build/temp.linux-i686-2.7/jnius/jnius.o
jnius/jnius.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
#error Do not use this file, it is the result of a failed Cython compilation.
^
error: command 'arm-linux-androideabi-gcc' failed with exit status 1
Compiling /home/roshan/AndroidApp/.buildozer/android/platform/python-for-android/build/pyjnius/pyjnius-master/jnius/jnius.pyx
Error compiling Cython file:
------------------------------------------------------------
...
cdef class ByteArray:
cdef LocalRef _jobject
cdef long _size
cdef jbyte *_buf
cdef jbyte[:] _arr
^
------------------------------------------------------------
jnius/jnius_nativetypes.pxi:19:15: Expected an identifier or literal
/home/roshan/AndroidApp/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
running build_ext
building 'jnius' extension
arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/roshan/.buildozer/android/platform/android-ndk-r9c/platforms/android-14/arch-arm -DNDEBUG -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/roshan/.buildozer/android/platform/android-ndk-r9c/platforms/android-14/arch-arm -fPIC -I/home/roshan/AndroidApp/.buildozer/android/platform/python-for-android/build/python-install/include/python2.7 -c jnius/jnius.c -o build/temp.linux-i686-2.7/jnius/jnius.o
jnius/jnius.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
#error Do not use this file, it is the result of a failed Cython compilation.
^
error: command 'arm-linux-androideabi-gcc' failed with exit status 1
# Command failed: ./distribute.sh -m "kivy" -d "Playstring"
How to resolve it. I tried installing cython again but it did not helped.

It looks like your Cython is too old. I had similar issues when I started Kivy development on 12.04. Try installing a newer version from PPA or using PIP.
From PPA:
sudo apt-add-repository ppa:cython-dev/master-ppa
sudo apt-get update
sudo apt-get install cython
Using PIP:
sudo apt-get install python-pip
sudo pip install --upgrade cython

Related

How to build opencv from source for android studio on windows?

I have to to build opencv from source due to opencv_contrib. Although I have tried many tutorials, I faild to build opencv from source.
The code I used:
cmake -G"MinGW Makefiles" -DANDROID_NDK=D:/androidNDK/android-ndk-r22b -DANDROID_SDK_ROOT=D:/android-sdk -DCMAKE_TOOLCHAIN_FILE=D:/androidNDK/android-ndk-r22b/build/cmake/android.toolchain.cmake -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF D:/OpenCV455/opencv-4.5.5
General configuration:
-- General configuration for OpenCV 4.5.5 =====================================
-- Version control: unknown
--
-- Platform:
-- Timestamp: 2022-11-19T00:58:08Z
-- Host: Windows 10.0.19043 AMD64
-- Target: Android 1 armv7-a
-- CMake: 3.21.3
-- CMake generator: MinGW Makefiles
-- CMake build tool: D:/MinGW1/mingw64/bin/mingw32-make.exe
-- Configuration: Release
--
-- CPU/HW features:
-- Baseline: NEON
-- requested: DETECT
--
-- C/C++:
-- Built as dynamic libs?: NO
-- C++ standard: 11
-- C++ Compiler: D:/androidNDK/android-ndk-r22b/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe (ver 11.0.5)
-- C++ flags (Release): -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Qunused-arguments -fvisibility=hidden -fvisibility-inlines-hidden -Oz -DNDEBUG -DNDEBUG
-- C++ flags (Debug): -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Qunused-arguments -fvisibility=hidden -fvisibility-inlines-hidden -O0 -fno-limit-debug-info -DDEBUG -D_DEBUG
-- C Compiler: D:/androidNDK/android-ndk-r22b/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
-- C flags (Release): -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Qunused-arguments -fvisibility=hidden -fvisibility-inlines-hidden -Oz -DNDEBUG -DNDEBUG
-- C flags (Debug): -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Qunused-arguments -fvisibility=hidden -fvisibility-inlines-hidden -O0 -fno-limit-debug-info -DDEBUG -D_DEBUG
-- Linker flags (Release): -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libgcc_real.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Wl,--exclude-libs,libunwind.a -Wl,--no-undefined -Qunused-arguments -Wl,--as-needed
-- Linker flags (Debug): -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libgcc_real.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Wl,--exclude-libs,libunwind.a -Wl,--no-undefined -Qunused-arguments -Wl,--as-needed
-- ccache: NO
-- Precompiled headers: NO
-- Extra dependencies: z dl m log
-- 3rdparty dependencies: libcpufeatures libprotobuf ade ittnotify libjpeg-turbo libwebp libpng libtiff libopenjp2 IlmImf quirc tegra_hal
--
-- OpenCV modules:
-- To be built: calib3d core dnn features2d flann gapi highgui imgcodecs imgproc java ml objdetect photo stitching video videoio
-- Disabled: world
-- Disabled by dependency: -
-- Unavailable: python2 python3 ts
-- Applications: android_examples
-- Documentation: NO
-- Non-free algorithms: NO
--
-- Android NDK: D:/androidNDK/android-ndk-r22b (ver 22.1.7171670)
-- Android ABI: armeabi-v7a
-- NDK toolchain: arm-linux-androideabi-clang
-- STL type: c++_static
-- Native API level: 16
-- Android SDK: D:/android-sdk (tools: 25.2.5 build tools: 33.0.0)
-- android tool: D:/android-sdk/tools/android.bat
-- SDK target: android-21
-- Projects build scripts: Ant/Eclipse compatible
--
-- GUI: NONE
--
-- Media I/O:
-- ZLib: z (ver 1.2.11)
-- JPEG: build-libjpeg-turbo (ver 2.1.2-62)
-- WEBP: build (ver encoder: 0x020f)
-- PNG: build (ver 1.6.37)
-- TIFF: build (ver 42 - 4.2.0)
-- JPEG 2000: build (ver 2.4.0)
-- OpenEXR: build (ver 2.3.0)
-- HDR: YES
-- SUNRASTER: YES
-- PXM: YES
-- PFM: YES
--
-- Video I/O:
--
-- Parallel framework: pthreads
--
-- Trace: YES (with Intel ITT)
--
-- Other third-party libraries:
-- Custom HAL: YES (carotene (ver 0.0.1))
-- Protobuf: build (3.19.1)
--
-- Python (for build): D:/Python37/python.exe
--
-- Java: export all functions
-- ant: D:/apache-ant-1.9.16/bin/ant.bat (ver 1.9.16)
-- Java wrappers: YES
-- Java tests: NO
--
-- Install to: D:/OpenCV455/buil36/install
-----------------------------------------------------------------**
The errors I get after running 'mingw32-make':
[97%] Built target opencv_java_android_source_copy
[97%]Generating OpenCV Android library project. SDK target:
[97%] Bui1ding OpenCV Android library project
[subant] No sub-builds to iterate on
Target '-code-gen' failed with message 'The following error occurred while executing this line:
D:\android-sdk\tools\ant\build.xml:655: null returned: -1073741819'.
Cannot execute '-compile' - '-code-gen' failed or was not executed.
Cannot execute '-dex' - '-compile' failed or was not executed.
Cannot execute '-package' - '-dex' failed or was not executed.
Cannot execute '-do-debug' - '-package' failed or was not executed.
Cannot execute 'debug' - '-do-debug' failed or was not executed.
BUILD FAILED
D:\android-sdk\tools\ant\build.xml:649: The following error occurred while executing this line:
D:\android-sdk\tools\ant\build.xml:655: null returned: -1073741819
Total time: 2 seconds
mingw32-make[2]: *** [modules\java\android_sdk\CMakeFiles\opencv_java_android.dir\build.make:77: bin/classes.jar] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:2689: modules/java/android_sdk/CMakeFiles/opencv_java_android.dir/all] Error 2
I get similar errors with ninja.
[1568/1595] Building OpenCV Android library project
FAILED: bin/classes.jar CMakeFiles/dephelper/opencv_java_android D:/OpenCV455/build36/bin/classes.jar D:/OpenCV455/build36/CMakeFiles/dephelper/opencv_java_android
cmd.exe /C "cd /D D:\OpenCV455\build36\android_sdk && D:\apache-ant-1.9.16\bin\ant.bat -q -noinput -k debug -Djava.target=1.6 -Djava.source=1.6 && D:\cmake-3.21.3\bin\cmake.exe -E touch D:/OpenCV455/build36/CMakeFiles/dephelper/opencv_java_android"
[subant] No sub-builds to iterate on
Target '-code-gen' failed with message 'The following error occurred while executing this line:
D:\android-sdk\tools\ant\build.xml:655: null returned: -1073741819'.
Cannot execute '-compile' - '-code-gen' failed or was not executed.
Cannot execute '-dex' - '-compile' failed or was not executed.
Cannot execute '-package' - '-dex' failed or was not executed.
Cannot execute '-do-debug' - '-package' failed or was not executed.
Cannot execute 'debug' - '-do-debug' failed or was not executed.
BUILD FAILED
D:\android-sdk\tools\ant\build.xml:649: The following error occurred while executing this line:
D:\android-sdk\tools\ant\build.xml:655: null returned: -1073741819
Total time: 1 second
[1572/1595] Building CXX object modules/gapi/CMakeFiles/opencv_perf_gapi.dir/perf/gpu/gapi_core_perf_tests_gpu.cpp.o
ninja: build stopped: subcommand failed.
here is the code with error.
in build.ninja file:
# Custom command for bin\classes.jar
build bin/classes.jar CMakeFiles/dephelper/opencv_java_android | ${cmake_ninja_workdir}bin/classes.jar ${cmake_ninja_workdir}CMakeFiles/dephelper/opencv_java_android: CUSTOM_COMMAND CMakeFiles/dephelper/opencv_java_android_source_copy android_sdk/build.xml android_sdk/local.properties android_sdk/proguard-project.txt android_sdk/project.properties android_sdk/AndroidManifest.xml || modules/java/android_sdk/opencv_java_android_source_copy modules/java_bindings_generator/gen_opencv_java_source
COMMAND = cmd.exe /C "cd /D D:\OpenCV455\build34\android_sdk && D:\apache-ant-1.9.16\bin\ant.bat -q -noinput -k debug -Djava.target=1.6 -Djava.source=1.6 && D:\cmake-3.21.3\bin\cmake.exe -E touch D:/OpenCV455/build34/CMakeFiles/dephelper/opencv_java_android"
DESC = Building OpenCV Android library project
restat = 1
in build.cmake file:
bin/classes.jar: CMakeFiles/dephelper/opencv_java_android_source_copy
bin/classes.jar: android_sdk/build.xml
bin/classes.jar: android_sdk/local.properties
bin/classes.jar: android_sdk/proguard-project.txt
bin/classes.jar: android_sdk/project.properties
bin/classes.jar: android_sdk/AndroidManifest.xml
#$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --blue --bold --progress-dir=D:\OpenCV455\build41\CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building OpenCV Android library project"
cd /d D:\OpenCV455\build41\android_sdk && call D:\apache-ant-1.9.16\bin\ant.bat -q -noinput -k debug -Djava.target=1.6 -Djava.source=1.6
cd /d D:\OpenCV455\build41\android_sdk && D:\cmake-3.21.3\bin\cmake.exe -E touch D:/OpenCV455/build41/CMakeFiles/dephelper/opencv_java_android
CMakeFiles/dephelper/opencv_java_android: bin/classes.jar
in build.xml file:
<do-only-if-manifest-hasCode
elseText="hasCode = false. Skipping aidl/renderscript/R.java">
<echo level="info">Handling aidl files...</echo>
<aidl executable="${aidl}"
framework="${project.target.framework.aidl}"
libraryBinAidlFolderPathRefid="project.library.bin.aidl.folder.path"
genFolder="${gen.absolute.dir}"
aidlOutFolder="${out.aidl.absolute.dir}">
<source path="${source.absolute.dir}"/>
</aidl>
How to fix it?
I try to find solutions for similar problem, and here maybe the only similar one. The developer suggetsted that:
Android SDK: not used, projects are not built
After that message Java-based projects should be skipped completely.
Try to upgrade your Android SDK "BuildTools".
CMAKE_CONFIG_GENERATOR="MinGW Makefiles"
There is ninja build tool in Android NDK. Use cmake -GNinja ... for better experience.
I don't quite grasp how to do, My build tools version is 33.0.0.
I found two options:
shell script (reference)
Install Git Bash and set it in PATH (C:\Program Files\Git\cmd)
Install Cmake 3.24.3 and set it in PATH (C:\Program Files\CMake\bin)
Install java and set it in PATH (C:\Program Files\Java\jdk1.8.0_202\bin), create variable JAVA_HOME(C:\Program Files\Java\jdk1.8.0_202)
Install C compiler (mingw or Visual Studio or etc.). If you use mingw, then you will need to install: mingw32-base-bin,
mingw32-gcc-fortran-bin,
mingw32-gcc-g++-bin,
mingw32-gcc-objc-bin,
msys-base-bin. And then in PATH add C:\MinGW\bin
You may also need WSL for Windows, but I did it just through Git Bash
Create a script in an empty folder and name it build.sh:
#!/bin/bash -e
myRepo=$(pwd)
CMAKE_GENERATOR_OPTIONS=-G"Visual Studio 17 2022"
#CMAKE_GENERATOR_OPTIONS=-G"Visual Studio 15 2017 Win64"
#CMAKE_GENERATOR_OPTIONS=(-G"Visual Studio 16 2019" -A x64) # CMake 3.14+ is required
if [ ! -d "$myRepo/gstreamer" ]; then
echo "cloning gstreamer"
git clone https://github.com/GStreamer/gstreamer.git
else
cd gstreamer
git pull --rebase
cd ..
fi
if [ ! -d "$myRepo/openexr" ]; then
echo "cloning openexr"
git clone https://github.com/AcademySoftwareFoundation/openexr.git
else
cd openexr
git pull --rebase
cd ..
fi
if [ ! -d "$myRepo/openblas" ]; then
echo "cloning openblas"
git clone https://github.com/xianyi/OpenBLAS.git
else
cd openblas
git pull --rebase
cd ..
fi
if [ ! -d "$myRepo/eigen" ]; then
echo "cloning eigen"
git clone https://gitlab.com/libeigen/eigen.git
else
cd eigen
git pull --rebase
cd ..
fi
if [ ! -d "$myRepo/opencv" ]; then
echo "cloning opencv"
git clone https://github.com/opencv/opencv.git
else
cd opencv
git pull --rebase
cd ..
fi
if [ ! -d "$myRepo/opencv_contrib" ]; then
echo "cloning opencv_contrib"
git clone https://github.com/opencv/opencv_contrib.git
else
cd opencv_contrib
git pull --rebase
cd ..
fi
if [ ! -d "$myRepo/tesseract" ]; then
echo "cloning tesseract"
git clone https://github.com/tesseract-ocr/tesseract.git
else
cd tesseract
git pull --rebase
cd ..
fi
RepoSource=opencv
mkdir -p build_opencv
pushd build_opencv
CMAKE_OPTIONS=( -DBUILD_opencv_world:BOOL=OFF -DBUILD_JAVA:BOOL=ON -DBUILD_PERF_TESTS:BOOL=OFF -DBUILD_TESTS:BOOL=OFF -DBUILD_DOCS:BOOL=OFF -DWITH_CUDA:BOOL=OFF -DBUILD_EXAMPLES:BOOL=OFF -DINSTALL_CREATE_DISTRIB=ON)
set -x
cmake "${CMAKE_GENERATOR_OPTIONS[#]}" "${CMAKE_OPTIONS[#]}" -DOPENCV_EXTRA_MODULES_PATH="$myRepo"/opencv_contrib/modules -DCMAKE_INSTALL_PREFIX="$myRepo/install/$RepoSource" "$myRepo/$RepoSource"
echo "************************* $Source_DIR -->debug"
cmake --build . --config debug
echo "************************* $Source_DIR -->release"
cmake --build . --config release
cmake --build . --target install --config release
cmake --build . --target install --config debug
popd
Open Git Bash, open the folder with our script in it and write bash build.sh
If you have following error syntax error: unexpected end of file, then here is the solution
As result we get opencv_java460.dll and opencv-460.jar
Cmake with ninja (taken from here, but modified)
Here I will describe what I used to build (it's not a fact that this is all I need or specific versions, but it worked for me):
Install Python and set it in PATH (C:\Users\volce\AppData\Local\Programs\Python\Python311\Scripts\ и C:\Users\volce\AppData\Local\Programs\Python\Python311\)
Install java 8 and set it in PATH and in JAVA_HOME (see above)
Install Cmake 3.24.3 (I haven't tried it on another version) and set it in PATH (see above)
Download NDK r25, unzip and add an environment variable ANDROID_NDK: C:\Users\volce\AppData\Local\Android\Sdk\ndk\android-ndk-r25b
Download SDK tools r25.2.3, platform-tools r25.0.1 and build-tools r25.0.1
In the SDK folder, replace the contents of the tools, build-tools and platform-tools folders with the downloaded ones
Also, in PATH I added: C:\Users\volce\AppData\Local\Android\Sdk\tools and C:\Users\volce\AppData\Local\Android\Sdk\platform-tools
Adding environment variables: ANDROID_HOME and ANDROID_SDK_ROOT, where we specify the path to the SDK (for example, C:\Users\volce\AppData\Local\Android\Sdk)
Download ant and set it in PATH (C:\apache-ant-1.10.12\bin и C:\apache-ant-1.10.12\lib) and create ANT_HOME (C:\apache-ant-1.10.12)
Download MinGw, install the necessary packages and set it in PATH (see above)
Download and install Visual Studio
What did I do next
Created a folder for our task
In it we do git clone https://github.com/opencv/opencv.git and git clone https://github.com/opencv/opencv_contrib.git
In the folder with opencv, go to samples\android and in the file CMakeLists.txt deleting add_subdirectory(15-puzzle) (because of this, I did not build)
Create a build folder in our root folder (which was created for building opencv)
We go into it and do git clone https://github.com/ninja-build/ninja.git
Open Visual Studio. In it: Tools->Command Line->Developer Command Line. In the command line, write the path to the created folder build and write python configure.py --bootstrap. This is how we configured ninja
Being in our build folder in the console, we write the following(don't forget to change the paths to your own):
cmake -GNinja -DCMAKE_MAKE_PROGRAM=E:\OpenCV\build\ninja.exe -DCMAKE_INSTALL_PREFIX=E:\OpenCV\install -DANDROID_PROJECTS_BUILD_TYPE="ANT" -DBUILD_ANDROID_PROJECTS=ON -DBUILD_EXAMPLES:BOOL=OFF -DBUILD_TESTS:BOOL=OFF -DBUILD_PERF_TESTS:BOOL=OFF -DBUILD_JAVA=ON -DBUILD_opencv_java=ON -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_FAT_JAVA_LIB=ON -DBUILD_PYTHON:BOOL=OFF -DINSTALL_ANDROID_EXAMPLES:BOOL=OFF -DANDROID_EXAMPLES_WITH_LIBS:BOOL=OFF -DBUILD_DOCS:BOOL=OFF -DWITH_OPENCL=ON -DANDROID_NDK_HOST_X64=ON -DANDROID_NDK=C:/Users/volce/AppData/Local/Android/Sdk/ndk/android-ndk-r25b/ -DANDROID_SDK=C:/Users/volce/AppData/Local/Android/Sdk -DCMAKE_TOOLCHAIN_FILE=C:/Users/volce/AppData/Local/Android/Sdk/ndk/android-ndk-r25b/build/cmake/android.toolchain.cmake -DANDROID_TOOLCHAIN=clang -DANDROID_STL=c++_static -DANDROID_ARM_NEON=ON -DANDROID_ABI='arm64-v8a, armeabi-v7a, x86_64, x86' -DANDROID_NDK_HOST_X64=ON -DBUILD_opencv_python3:BOOL=OFF -DBUILD_opencv_python2:BOOL=OFF -DOPENCV_EXTRA_MODULES_PATH=E:/OpenCV/opencv_contrib/modules -DOPENCV_ENABLE_NONFREE=ON -DANDROID_NATIVE_API_LEVEL=25 -DANDROID_TARGET_SDK_VERSION=32 -DANDROID_MIN_SDK_VERSION=21 E:\OpenCV\opencv
After execution , write ninja -j8 in console
After waiting for the execution of the previous command, we write ninja install
As result we get the OpenCV SDK for Android
How to integrate OpenCV 4.6.0 in your project -> https://www.youtube.com/watch?v=bR7lL886-uc

Qt Android Error: arm-linux-androideabi-g++: error: unrecognized command line option '-fstack-protector-strong'

I have an error while building android application with newly installed Qt 5.8.0 for Android in Windows 10
This is my compile output:
11:06:25: Running steps for project untitled5...
11:06:26: Starting: "C:\Qt\Qt5.8.0_Android\5.8\android_armv7\bin\qmake.exe" C:\Users\mir.moezi\Documents\untitled5\untitled5.pro -spec android-g++ "CONFIG+=debug" "CONFIG+=qml_debug"
11:06:28: The process "C:\Qt\Qt5.8.0_Android\5.8\android_armv7\bin\qmake.exe" exited normally.
11:06:29: Starting: "C:\Qt\Qt5.8.0_Android\Tools\mingw530_32\bin\mingw32-make.exe" qmake_all
mingw32-make: Nothing to be done for 'qmake_all'.
11:06:31: The process "C:\Qt\Qt5.8.0_Android\Tools\mingw530_32\bin\mingw32-make.exe" exited normally.
11:06:31: Starting: "C:\Qt\Qt5.8.0_Android\Tools\mingw530_32\bin\mingw32-make.exe"
C:\Qt\Qt5.8.0_Android\5.8\android_armv7\bin\uic.exe ..\untitled5\mainwindow.ui -o ui_mainwindow.h
C:\Qt\Android\android-ndk-r10/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++ -c -fstack-protector-strong -DANDROID -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -fno-builtin-memmove --sysroot=C:\Qt\Android\android-ndk-r10/platforms/android-16/arch-arm/ -g -g -marm -O0 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\untitled5 -I. -I..\..\..\..\Qt\Qt5.8.0_Android\5.8\android_armv7\include -I..\..\..\..\Qt\Qt5.8.0_Android\5.8\android_armv7\include\QtWidgets -I..\..\..\..\Qt\Qt5.8.0_Android\5.8\android_armv7\include\QtGui -I..\..\..\..\Qt\Qt5.8.0_Android\5.8\android_armv7\include\QtCore -I. -I. -I..\..\..\..\Qt\Android\android-ndk-r10\sources\cxx-stl\gnu-libstdc++\4.8\include -I..\..\..\..\Qt\Android\android-ndk-r10\sources\cxx-stl\gnu-libstdc++\4.8\libs\armeabi-v7a\include -I..\..\..\..\Qt\Android\android-ndk-r10\platforms\android-16\arch-arm\usr\include -I..\..\..\..\Qt\Qt5.8.0_Android\5.8\android_armv7\mkspecs\android-g++ -o main.obj ..\untitled5\main.cpp
arm-linux-androideabi-g++: error: unrecognized command line option '-fstack-protector-strong'
Makefile:1291: recipe for target 'main.obj' failed
mingw32-make: *** [main.obj] Error 1
11:06:33: The process "C:\Qt\Qt5.8.0_Android\Tools\mingw530_32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project untitled5 (kit: Android for armeabi-v7a (GCC 4.8, Qt 5.8.0))
When executing step "Make"
11:06:33: Elapsed time: 00:08.
Please help me to solve this error!
Here is my packages installed :
qt-opensource-windows-x86-android-5.8.0
JDK.7.Update.80.x64
apache-ant-1.10.1-bin
Android-NDK32-r10-windows-x86_64
Android.SDK.Release.v24.4.1.Windowsinstaller_r24.4.1-windows
what is '-fstack-protector-strong' ?
I think this prevents Qt Creator from continuing !
This problem was because of my android NDK, it was a little old.
I removed Android-NDK32-r10-windows-x86_64 and installed Android-NDK32-r14-windows-x86_64 and now it works fine.

Using buildozer with Kivy 1.9.1-dev

I want to contribute to Kivy 1.9.1-dev.
Trying to debug on android, using buildozer, from ~/ I've tried:
git clone git://github.com/kivy/kivy.git
cd kivy
python setup.py build_ext --inplace -f
then from ~/ I did:
git clone https://github.com/kivy/buildozer.git
cd buildozer
sudo python2.7 setup.py install
finally from ~/kivy-test/
buildozer init
buildozer android debug deploy run
eventually I get the following error:
Detected compiler is unix
building 'kivy.graphics.vertex_instructions' extension
ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/navatm/.buildozer/android/platform/android-ndk-r9c/platforms/android-14/arch-arm -DNDEBUG -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/navatm/.buildozer/android/platform/android-ndk-r9c/platforms/android-14/arch-arm -fPIC -I/home/navatm/.buildozer/android/platform/android-ndk-r9c/platforms/android-14/arch-arm/usr/include -I/home/navatm/code/kivy-test/.buildozer/android/platform/python-for-android/build/python-install/include/python2.7 -c kivy/graphics/vertex_instructions.c -o build/temp.linux-x86_64-2.7/kivy/graphics/vertex_instructions.o
kivy/graphics/vertex_instructions.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
#error Do not use this file, it is the result of a failed Cython compilation.
^
error: command 'ccache' failed with exit status 1
# Command failed: ./distribute.sh -m "kivy" -d "myapp"
#
# 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
Any suggestions?

Buildozer can't compile Cython

I am trying to build my kivy application, but having run buildozer android debug --verbose the only I get is following:
[...]
Run prebuild
Call prebuild_hostpython
Call prebuild_python
Call prebuild_sdl
Call prebuild_pygame
Call prebuild_pyjnius
Call prebuild_android
Call prebuild_kivy
Run build
Skipped build_hostpython
Skipped build_python
Skipped build_sdl
Skipped build_pygame
Call build_pyjnius
Entering in ARM environment
Compiler found at /home/michal/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc
/home/michal/Dokumenty/Projekty/Labirynt/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
running build_ext
building 'jnius' extension
arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/michal/.buildozer/android/platform/android-ndk-r9c/platforms/android-14/arch-arm -DNDEBUG -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/michal/.buildozer/android/platform/android-ndk-r9c/platforms/android-14/arch-arm -fPIC -I/home/michal/Dokumenty/Projekty/Labirynt/.buildozer/android/platform/python-for-android/build/python-install/include/python2.7 -c jnius/jnius.c -o build/temp.linux-x86_64-2.7/jnius/jnius.o
jnius/jnius.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
#error Do not use this file, it is the result of a failed Cython compilation.
^
error: command 'arm-linux-androideabi-gcc' failed with exit status 1
Error compiling Cython file:
------------------------------------------------------------
...
if py_arg is None:
j_args[index].l = NULL
elif isinstance(py_arg, basestring) and \
argtype in ('Ljava/lang/String;', 'Ljava/lang/Object;'):
j_args[index].l = j_env[0].NewStringUTF(
j_env, <char *><bytes>py_arg.encode('utf-8'))
^
------------------------------------------------------------
jnius/jnius_conversion.pxi:54:31: Casting temporary Python object to non-numeric non-Python type
/home/michal/Dokumenty/Projekty/Labirynt/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
running build_ext
building 'jnius' extension
arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/michal/.buildozer/android/platform/android-ndk-r9c/platforms/android-14/arch-arm -DNDEBUG -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/michal/.buildozer/android/platform/android-ndk-r9c/platforms/android-14/arch-arm -fPIC -I/home/michal/Dokumenty/Projekty/Labirynt/.buildozer/android/platform/python-for-android/build/python-install/include/python2.7 -c jnius/jnius.c -o build/temp.linux-x86_64-2.7/jnius/jnius.o
jnius/jnius.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
#error Do not use this file, it is the result of a failed Cython compilation.
^
error: command 'arm-linux-androideabi-gcc' failed with exit status 1
# Command failed: ./distribute.sh -m "kivy" -d "testapp"
I'm using Archlinux, 64bit, python2 2.7.8-2, with aur/python2-kivy-git.
When i'm trying to install aur/python2-kivy I get
Found GLES 2.0 headers at /usr/include/GLES2/gl2.h
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'dependency_links'
warnings.warn(msg)
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
running build
running build_py
running build_ext
Build configuration is:
* use_rpi = False
* use_opengl_es2 = True
* use_opengl_debug = False
* use_glew = False
* use_sdl = False
* use_ios = False
* use_mesagl = False
* use_x11 = False
* use_gstreamer = True
* use_avfoundation = False
Generate config.h
Generate config.pxi
Detected compiler is unix
skipping 'kivy/graphics/texture.c' Cython extension (up-to-date)
skipping 'kivy/graphics/vertex.c' Cython extension (up-to-date)
skipping 'kivy/graphics/fbo.c' Cython extension (up-to-date)
skipping 'kivy/graphics/context.c' Cython extension (up-to-date)
skipping 'kivy/properties.c' Cython extension (up-to-date)
skipping 'kivy/graphics/context_instructions.c' Cython extension (up-to-date)
skipping 'kivy/graphics/instructions.c' Cython extension (up-to-date)
skipping 'kivy/graphics/stencil_instructions.c' Cython extension (up-to-date)
skipping 'kivy/graphics/opengl.c' Cython extension (up-to-date)
skipping 'kivy/graphics/transformation.c' Cython extension (up-to-date)
skipping 'kivy/graphics/vbo.c' Cython extension (up-to-date)
skipping 'kivy/graphics/opengl_utils.c' Cython extension (up-to-date)
skipping 'kivy/graphics/c_opengl_debug.c' Cython extension (up-to-date)
skipping 'kivy/graphics/gl_instructions.c' Cython extension (up-to-date)
cythoning kivy/lib/gstplayer/_gstplayer.pyx to kivy/lib/gstplayer/_gstplayer.c
Error compiling Cython file:
------------------------------------------------------------
...
g_object_set_void(self.playbin, 'video-sink', self.fakesink)
# configure playbin
g_object_set_int(self.pipeline, 'async-handling', 1)
c_uri = <bytes>self.uri.encode('utf-8')
^
------------------------------------------------------------
kivy/lib/gstplayer/_gstplayer.pyx:259:16: Storing unsafe C derivative of temporary Python reference
building 'kivy.lib.gstplayer._gstplayer' extension
gcc -pthread -DNDEBUG -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/python2.7 -c kivy/lib/gstplayer/_gstplayer.c -o build/temp.linux-x86_64-2.7/kivy/lib/gstplayer/_gstplayer.o
kivy/lib/gstplayer/_gstplayer.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
#error Do not use this file, it is the result of a failed Cython compilation.
^
error: command 'gcc' failed with exit status 1
How can I make it work?
This is an issue with the Cython version 0.21 and old code. The easiest solution is to downgrade Cython to 0.20, which works.
To use the newer Cython, delete the downloaded pyjnius and let buildozer download the most recent version:
rm ~/.buildozer/android/packages/pyjnius-master.zip
But the newer Cython also needs newer Kivy code. In your buildozer.spec, change kivy in the requirements to kivy==master to get the most recent Kivy code.

Android SDK/NDK error with python-for-android/kivy

I'm on Fedora Linux 19, using the latest Android SDK, latest java SDK, and NDK=R9. Using the instructions here, I'm trying to create a python/kivy installation specialized for android, by running the command, ./distribute.sh -m "kivy". It produces the output below. Can anyone tell me what's going wrong here, and what I can do to fix it? Thank you.
./dist*sh -m "kivy"
Check build dependencies for Fedora
Avoid check build dependencies, unknow platform Fedora
Check enviromnent
SDK located at /home/ljm/Developer/android-sdks
NDK located at /home/ljm/Developer/android-ndk-r9
NDK version is r9
API level set to 18
Check mandatory tools
Distribution will be located at /home/ljm/Developer/workspace/python-for-android/dist/default
The distribution /home/ljm/Developer/workspace/python-for-android/dist/default already exist
Press a key to remove it, or Control + C to abort.
Entering in ARM enviromnent
Compiler found at /home/ljm/Developer/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc
PATH is /home/ljm/Developer/android-ndk-r9/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/:/home/ljm/Developer/android-ndk-r9/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86_64/bin/:/home/ljm/Developer/android-ndk-r9:/home/ljm/Developer/android-sdks/tools:/home/ljm/Developer/android-ndk-r9:/home/ljm/Developer/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/:/home/ljm/Developer/android-sdks:/home/ljm/Developer/android-sdks/platform-tools:/home/ljm/Developer/android-sdks/tools:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/local/sbin:/usr/sbin:/homeljm.local/bin:/homeljmbin
Leaving ARM enviromnent
Read kivy recipe
Module kivy depend on pygame pyjnius android
Read pygame recipe
Module pygame depend on python sdl
Read pyjnius recipe
Module pyjnius depend on python sdl
Read android recipe
Module android depend on pygame
Read python recipe
Module python depend on hostpython
Read sdl recipe
Module sdl depend on python
Ignored python, already processed
Ignored sdl, already processed
Ignored pygame, already processed
Read hostpython recipe
Ignored python, already processed
Modules changed to hostpython python sdl pygame pyjnius android kivy
Run get packages
Download package for hostpython
Module hostpython already downloaded
Download package for python
Module python already downloaded
Download package for sdl
No package for sdl
Download package for pygame
Module pygame already downloaded
Download package for pyjnius
Module pyjnius already downloaded
Download package for android
No package for android
Download package for kivy
Module kivy already downloaded
Run prebuild
Call prebuild_hostpython
Call prebuild_python
Call prebuild_sdl
Call prebuild_pygame
Call prebuild_pyjnius
Call prebuild_android
Call prebuild_kivy
Run build
Call build_hostpython
Call build_python
Call build_sdl
Entering in ARM enviromnent
Compiler found at /home/ljm/Developer/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc
Android NDK: WARNING:/home/ljm/Developer/workspace/python-for-android/src/jni/../jni/application/Android.mk:application: non-system libraries in linker flags: -lpython2.7
Android NDK: This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES
Android NDK: or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the
Android NDK: current module
Android NDK: WARNING:/home/ljm/Developer/workspace/python-for-android/src/jni/../jni/png/Android.mk:png: LOCAL_LDLIBS is always ignored for static libraries
rm -f /home/ljm/Developer/workspace/python-for-android/src/libs/armeabi/lib*.so /home/ljm/Developer/workspace/python-for-android/src/libs/armeabi-v7a/lib*.so /home/ljm/Developer/workspace/python-for-android/src/libs/mips/lib*.so /home/ljm/Developer/workspace/python-for-android/src/libs/x86/lib*.so
rm -f /home/ljm/Developer/workspace/python-for-android/src/libs/armeabi/gdbserver /home/ljm/Developer/workspace/python-for-android/src/libs/armeabi-v7a/gdbserver /home/ljm/Developer/workspace/python-for-android/src/libs/mips/gdbserver /home/ljm/Developer/workspace/python-for-android/src/libs/x86/gdbserver
rm -f /home/ljm/Developer/workspace/python-for-android/src/libs/armeabi/gdb.setup /home/ljm/Developer/workspace/python-for-android/src/libs/armeabi-v7a/gdb.setup /home/ljm/Developer/workspace/python-for-android/src/libs/mips/gdb.setup /home/ljm/Developer/workspace/python-for-android/src/libs/x86/gdb.setup
Install : libapplication.so => libs/armeabi/libapplication.so
install -p /home/ljm/Developer/workspace/python-for-android/src/obj/local/armeabi/libapplication.so /home/ljm/Developer/workspace/python-for-android/src/libs/armeabi/libapplication.so
/home/ljm/Developer/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-strip --strip-unneeded /home/ljm/Developer/workspace/python-for-android/src/libs/armeabi/libapplication.so
Install : libsdl.so => libs/armeabi/libsdl.so
install -p /home/ljm/Developer/workspace/python-for-android/src/obj/local/armeabi/libsdl.so /home/ljm/Developer/workspace/python-for-android/src/libs/armeabi/libsdl.so
/home/ljm/Developer/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-strip --strip-unneeded /home/ljm/Developer/workspace/python-for-android/src/libs/armeabi/libsdl.so
Install : libsdl_main.so => libs/armeabi/libsdl_main.so
install -p /home/ljm/Developer/workspace/python-for-android/src/obj/local/armeabi/libsdl_main.so /home/ljm/Developer/workspace/python-for-android/src/libs/armeabi/libsdl_main.so
/home/ljm/Developer/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-strip --strip-unneeded /home/ljm/Developer/workspace/python-for-android/src/libs/armeabi/libsdl_main.so
Install : libsdl_ttf.so => libs/armeabi/libsdl_ttf.so
install -p /home/ljm/Developer/workspace/python-for-android/src/obj/local/armeabi/libsdl_ttf.so /home/ljm/Developer/workspace/python-for-android/src/libs/armeabi/libsdl_ttf.so
/home/ljm/Developer/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-strip --strip-unneeded /home/ljm/Developer/workspace/python-for-android/src/libs/armeabi/libsdl_ttf.so
Install : libsdl_image.so => libs/armeabi/libsdl_image.so
install -p /home/ljm/Developer/workspace/python-for-android/src/obj/local/armeabi/libsdl_image.so /home/ljm/Developer/workspace/python-for-android/src/libs/armeabi/libsdl_image.so
/home/ljm/Developer/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-strip --strip-unneeded /home/ljm/Developer/workspace/python-for-android/src/libs/armeabi/libsdl_image.so
Install : libsqlite3.so => libs/armeabi/libsqlite3.so
install -p /home/ljm/Developer/workspace/python-for-android/src/obj/local/armeabi/libsqlite3.so /home/ljm/Developer/workspace/python-for-android/src/libs/armeabi/libsqlite3.so
/home/ljm/Developer/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-strip --strip-unneeded /home/ljm/Developer/workspace/python-for-android/src/libs/armeabi/libsqlite3.so
Install : libsdl_mixer.so => libs/armeabi/libsdl_mixer.so
install -p /home/ljm/Developer/workspace/python-for-android/src/obj/local/armeabi/libsdl_mixer.so /home/ljm/Developer/workspace/python-for-android/src/libs/armeabi/libsdl_mixer.so
/home/ljm/Developer/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-strip --strip-unneeded /home/ljm/Developer/workspace/python-for-android/src/libs/armeabi/libsdl_mixer.so
Leaving ARM enviromnent
Call build_pygame
Entering in ARM enviromnent
Compiler found at /home/ljm/Developer/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc
running install
running build
running build_py
running build_ext
building 'pygame.surface' extension
arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/ljm/Developer/android-ndk-r9/platforms/android-18/arch-arm -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/ljm/Developer/android-ndk-r9/platforms/android-18/arch-arm -I/home/ljm/Developer/workspace/python-for-android/src/jni/png -I/home/ljm/Developer/workspace/python-for-android/src/jni/jpeg -I/home/ljm/Developer/workspace/python-for-android/src/jni/sdl/include -I/home/ljm/Developer/workspace/python-for-android/src/jni/sdl_mixer -I/home/ljm/Developer/workspace/python-for-android/src/jni/sdl_ttf -I/home/ljm/Developer/workspace/python-for-android/src/jni/sdl_image -fPIC -D_REENTRANT -I/home/ljm/Developer/workspace/python-for-android/build/python-install/include/python2.7 -c src/surface.c -o build/temp.linux-i686-2.7/src/surface.o
In file included from /home/ljm/Developer/workspace/python-for-android/build/python-install/include/python2.7/Python.h:126:0,
from src/pygame.h:75,
from src/surface.h:28,
from src/surface.c:26:
/home/ljm/Developer/workspace/python-for-android/build/python-install/include/python2.7/modsupport.h:27:1: warning: 'PyArg_ParseTuple' is an unrecognized format function type [-Wformat=]
PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);
^
src/surface.c: In function 'surf_get_locked':
src/surface.c:755:9: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
Py_RETURN_TRUE;
^
src/surface.c:756:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
Py_RETURN_FALSE;
^
src/surface.c: In function 'surf_convert_alpha':
src/surface.c:1279:28: warning: variable 'src' set but not used [-Wunused-but-set-variable]
SDL_Surface *newsurf, *src;
^
arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/ljm/Developer/android-ndk-r9/platforms/android-18/arch-arm -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/ljm/Developer/android-ndk-r9/platforms/android-18/arch-arm -I/home/ljm/Developer/workspace/python-for-android/src/jni/png -I/home/ljm/Developer/workspace/python-for-android/src/jni/jpeg -I/home/ljm/Developer/workspace/python-for-android/src/jni/sdl/include -I/home/ljm/Developer/workspace/python-for-android/src/jni/sdl_mixer -I/home/ljm/Developer/workspace/python-for-android/src/jni/sdl_ttf -I/home/ljm/Developer/workspace/python-for-android/src/jni/sdl_image -fPIC -D_REENTRANT -I/home/ljm/Developer/workspace/python-for-android/build/python-install/include/python2.7 -c src/alphablit.c -o build/temp.linux-i686-2.7/src/alphablit.o
In file included from /home/ljm/Developer/workspace/python-for-android/build/python-install/include/python2.7/Python.h:126:0,
from src/pygame.h:75,
from src/surface.h:28,
from src/alphablit.c:25:
/home/ljm/Developer/workspace/python-for-android/build/python-install/include/python2.7/modsupport.h:27:1: warning: 'PyArg_ParseTuple' is an unrecognized format function type [-Wformat=]
PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);
^
In file included from src/surface.h:28:0,
from src/alphablit.c:25:
src/pygame.h:678:14: warning: 'PyGAME_C_API' defined but not used [-Wunused-variable]
static void* PyGAME_C_API[PYGAMEAPI_TOTALSLOTS] = { NULL };
^
arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/ljm/Developer/android-ndk-r9/platforms/android-18/arch-arm -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/ljm/Developer/android-ndk-r9/platforms/android-18/arch-arm -I/home/ljm/Developer/workspace/python-for-android/src/jni/png -I/home/ljm/Developer/workspace/python-for-android/src/jni/jpeg -I/home/ljm/Developer/workspace/python-for-android/src/jni/sdl/include -I/home/ljm/Developer/workspace/python-for-android/src/jni/sdl_mixer -I/home/ljm/Developer/workspace/python-for-android/src/jni/sdl_ttf -I/home/ljm/Developer/workspace/python-for-android/src/jni/sdl_image -fPIC -D_REENTRANT -I/home/ljm/Developer/workspace/python-for-android/build/python-install/include/python2.7 -c src/surface_fill.c -o build/temp.linux-i686-2.7/src/surface_fill.o
In file included from /home/ljm/Developer/workspace/python-for-android/build/python-install/include/python2.7/Python.h:126:0,
from src/pygame.h:75,
from src/surface.h:28,
from src/surface_fill.c:20:
/home/ljm/Developer/workspace/python-for-android/build/python-install/include/python2.7/modsupport.h:27:1: warning: 'PyArg_ParseTuple' is an unrecognized format function type [-Wformat=]
PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);
^
In file included from src/surface.h:28:0,
from src/surface_fill.c:20:
src/pygame.h:678:14: warning: 'PyGAME_C_API' defined but not used [-Wunused-variable]
static void* PyGAME_C_API[PYGAMEAPI_TOTALSLOTS] = { NULL };
^
/home/ljm/Developer/workspace/python-for-android/src/tools/liblink -lm -L/home/ljm/Developer/workspace/python-for-android/build/libs -L/home/ljm/Developer/workspace/python-for-android/src/obj/local/armeabi/ -lm -lz -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/ljm/Developer/android-ndk-r9/platforms/android-18/arch-arm -I/home/ljm/Developer/workspace/python-for-android/src/jni/png -I/home/ljm/Developer/workspace/python-for-android/src/jni/jpeg -I/home/ljm/Developer/workspace/python-for-android/src/jni/sdl/include -I/home/ljm/Developer/workspace/python-for-android/src/jni/sdl_mixer -I/home/ljm/Developer/workspace/python-for-android/src/jni/sdl_ttf -I/home/ljm/Developer/workspace/python-for-android/src/jni/sdl_image build/temp.linux-i686-2.7/src/surface.o build/temp.linux-i686-2.7/src/alphablit.o build/temp.linux-i686-2.7/src/surface_fill.o -L/home/ljm/Developer/workspace/python-for-android/build/python-install/lib -lsdl -lm -lpython2.7 -o build/lib.linux-i686-2.7/pygame/surface.so
arm-linux-androideabi-ld: -arch: unknown option
arm-linux-androideabi-ld: use the --help option for usage information
error: command '/home/ljm/Developer/workspace/python-for-android/src/tools/liblink' failed with exit status 1
In accordance with the above suggestion of downgrading the API and NDK (to 14 and r8c, respectively), I've downgraded the android tools, and the problem seems to have been resolved. Thanks!

Categories

Resources