build llvm clang4.0 for android armeabi - android

I am trying to build llvm and clang4.0 for android armeabi.
Currently I have done these:
1. from:
http://hardenedlinux.org/toolchains/2016/04/01/How_to_build_Clang_toolchains_for_Android.html
I have checkout source code :
repo init -u https://android.googlesource.com/platform/manifest -b llvm
repo sync
python external/clang/build.py
The build is going successful, but it will consume over 100G diskspace and about 8 hours. what's more, it is not clang 4.0.
2.
from http://llvm.org/docs/GettingStarted.html
I checked out the source code:
git clone http://llvm.org/git/llvm.git
cd llvm/tools
git clone http://llvm.org/git/clang.git
cd llvm/projects
git clone http://llvm.org/git/compiler-rt.git
finally I build it with llvm/cmake/platforms/android.cmake
this android.cmake can be shown below:
# Toolchain config for Android NDK.
# This is expected to be used with a standalone Android toolchain (see
# docs/STANDALONE-TOOLCHAIN.html in the NDK on how to get one).
#
# Usage:
# mkdir build; cd build
# cmake ..; make
# mkdir android; cd android
# cmake -DLLVM_ANDROID_TOOLCHAIN_DIR=/path/to/android/ndk \
# -DCMAKE_TOOLCHAIN_FILE=../../cmake/platforms/Android.cmake ../..
# make <target>
SET(CMAKE_SYSTEM_NAME Linux)
IF(NOT CMAKE_C_COMPILER)
SET(CMAKE_C_COMPILER ${CMAKE_BINARY_DIR}/../bin/clang)
ENDIF()
IF(NOT CMAKE_CXX_COMPILER)
SET(CMAKE_CXX_COMPILER ${CMAKE_BINARY_DIR}/../bin/clang++)
ENDIF()
SET(ANDROID "1" CACHE STRING "ANDROID" FORCE)
SET(ANDROID_COMMON_FLAGS "-target arm-linux-androideabi -- sysroot=${LLVM_ANDROID_TOOLCHAIN_DIR}/sysroot -B${LLVM_ANDROID_TOOLCHAIN_DIR}")
SET(CMAKE_C_FLAGS "${ANDROID_COMMON_FLAGS}" CACHE STRING "toolchain_cflags" FORCE)
SET(CMAKE_CXX_FLAGS "${ANDROID_COMMON_FLAGS}" CACHE STRING "toolchain_cxxflags" FORCE)
SET(CMAKE_EXE_LINKER_FLAGS "-pie" CACHE STRING "toolchain_exelinkflags" FORCE)
But it always build x86 target, it does not build armeabi target.
My building host OS is Ubuntu 16.04 LTS 64 bits.
Please How can I build llvm and clang 4.0 for armeabi targeting android ?

I believe you're interested in cross-compiler targeting android. In this case llvm/cmake/platforms/android.cmake is of no use (it's used for building via compiler, not building the compiler itself).
Please refer to http://llvm.org/docs/CMake.html for generic LLVM build instructions. But in your case I believe you'd need to set LLVM_TARGETS_TO_BUILD to "ARM;AArch64" and LLVM_DEFAULT_TARGET_TRIPLE to "arm-linux-androideabi" in LLVM's cmake invocation.

Related

Build boost for android with hunter

my troubles are the following.
A boost is integrated to my CMake with hunter:
include(cmake/HunterGate.cmake)
cmake_host_system_information(RESULT HUNTER_JOBS_NUMBER QUERY NUMBER_OF_LOGICAL_CORES)
HunterGate(
URL "https://github.com/cpp-pm/hunter/archive/v0.24.0.tar.gz"
SHA1 "a3d7f4372b1dcd52faa6ff4a3bd5358e1d0e5efd"
LOCAL
)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_DEBUG_LIBS OFF) # ignore debug libs and
set(Boost_USE_RELEASE_LIBS ON) # only find release libs
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
set(BOOST_COMPONENTS)
list(APPEND BOOST_COMPONENTS system program_options)
hunter_add_package(Boost COMPONENTS ${BOOST_COMPONENTS})
find_package(Boost CONFIG COMPONENTS ${BOOST_COMPONENTS})
I build my project on linux Ubuntu for android with the following parameters:
config-android : _android
cd $< && cmake \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_SYSTEM_NAME=Android \
-DCMAKE_TOOLCHAIN_FILE=$(NDK)/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=$(ABI) \
-DANDROID_PLATFORM=android-$(MINSDKVERSION) \
-DANDROID_TARGET=$(TARGET) \
..
If I assign $ABI=armeabi-v7a, everything is all right. As I see, the boost is built on the following configuration:
[ 75%] Performing build step for 'Boost-system'
Performing configuration checks
- default address-model : 32-bit [1]
- default architecture : arm [1]
Building the Boost C++ Libraries.
However, if assign any other interface, for example, $ABI=x86_64, I have an error:
ld: error: /home/vitali/.hunter/_Base/a3d7f43/0db57b3/73320e1/Install/lib/libboost_program_options-mt-a64.a(cmdline.o) is incompatible with elf_x86_64
I suspect the reason for that error is the hunter builds boost not for the assigned ABI. As I see, it shows the same configuration as it was for arm ABI:
[ 75%] Performing build step for 'Boost-system'
Performing configuration checks
- default address-model : 32-bit [1]
- default architecture : arm [1]
Building the Boost C++ Libraries.
My question is the following: how to make hunter to build boost for the appropriate ABI ?
Thanks!
I've met the same problem with Hunter. It's easy to solve. Create (or add to) file cmake/Hunter/config.cmake the following lines to pass additional cmake/ndk-toolchain parameters to boost build:
if(ANDROID)
hunter_config(
Boost
VERSION ${HUNTER_Boost_VERSION}
CMAKE_ARGS
CMAKE_ANDROID_ARCH_ABI=${ANDROID_ABI}
ANDROID_ABI=${ANDROID_ABI}
ANDROID_PLATFORM=${ANDROID_PLATFORM}
)
else()
hunter_config(
Boost
VERSION ${HUNTER_Boost_VERSION}
)
endif()
Generally, you have to pass ANDROID_ABI and ANDROID_PLATFORM. Hunter runs new cmake process to build boost, ndk toolchain is passed, abi & platform are not. So, toolchain does not know how to build boost and builds it by default. As result, there are many link errors.

Build CMake library without Android-Studio (by command-line or GUI)

It seems, Android-Studio sets specific CMake options,
And I can not build with command-line (outside of Android-Studio) no matter what I tried!!
Is there any way to build an Android project's CMake library without even opening Android-Studio?
Note: I already found solution and will share answer to this shortly.
Yes there were some options and/or variables that need to be set for CMake command-line build to work (without even opening Android-Studio).
1. Firstly, create the my-toolchain.cmake file (beside your project, maybe in config dir), with content below:
#
# Allows compiling outside of Android-Studio.
#
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
set(CMAKE_TOOLCHAIN_DIRECTORY "$ENV{ANDROID_HOME}/ndk-bundle/build/cmake")
if(NOT CMAKE_TOOLCHAIN_FILE)
if(NOT ANDROID_ABI)
# Default to 32 Bit ARMv7 CPU.
set(ANDROID_ABI "armeabi-v7a")
endif()
if(NOT ANDROID_PLATFORM)
set(ANDROID_PLATFORM "android-15")
endif()
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_TOOLCHAIN_DIRECTORY}/android.toolchain.cmake")
endif()
if(WIN32 AND NOT CMAKE_MAKE_PROGRAM)
set(CMAKE_MAKE_PROGRAM "$ENV{ANDROID_HOME}/ndk-bundle/prebuilt/windows/bin/make.exe" CACHE INTERNAL "" FORCE)
endif()
2. Secondly, Add the file created in last step into your project, for example:
cmake_minimum_required(VERSION 3.2)
# Detect toolchain.
include(config/my-toolchain.cmake)
project(MyProject C CXX)
# ... and so on ...
3. Finally, in console cd where your CMakeLists.txt file is, and build with commands like:
cmake -H. -B .build -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DANDROID_PLATFORM=android-14 -D ANDROID_ABI=armeabi-v7a
cd .build
"%ANDROID_HOME%\ndk-bundle\prebuilt\windows\bin\make.exe" install INSTALL_ROOT="%CD%\.build"
Note that last command of Step-3 changes based on your operating-system, but above should work for Windows if you have ANDROID_HOME environment-variable set to Android-SDK root directory (which of course, needs NDK extracted in ndk-bundle sub-dir).
All done!
Just repeat Step-3 for each CPU architecture, i.e. change ANDROID_ABI to one of possible options:
armeabi-v7a, arm64-v8a, x86, x86_64, mips, mips64
Although, mips and mips64 are deprecated by now (and Android NDK r16b was last version supporting them).

Android Studio ERROR: Cause: executing external native build for cmake /path/to/project/app/tools/CMakeLists.txt

I have downloaded WireGuard from Github (link) after run app by android studio I have this error:
ERROR: Cause: executing external native build for cmake /path/to/project/app/tools/CMakeLists.txt
and android_gradle_generate_cmake_ninja_json_x86.stderr.txt show this:
CMake Error at CMakeLists.txt:11 (add_executable):
Cannot find source file:
wireguard-tools/src/wg-quick/android.c
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx
CMake Error: CMake can not determine linker language for target: libwg-quick.so
wireguard-tools folder is empty. maybe it's content must build by cmake from CMakeLists.txt.
I don't understand cmake.
CMakeLists.txt content is:
# SPDX-License-Identifier: Apache-2.0
#
# Copyright © 2018-2019 WireGuard LLC. All Rights Reserved.
cmake_minimum_required(VERSION 3.4.1)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
# Work around https://github.com/android-ndk/ndk/issues/602
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
add_executable(libwg-quick.so wireguard-tools/src/wg-quick/android.c ndk-compat/compat.c)
target_compile_options(libwg-quick.so PUBLIC -O3 -std=gnu11 -Wall -include ${CMAKE_CURRENT_SOURCE_DIR}/ndk-compat/compat.h -DWG_PACKAGE_NAME=\"${ANDROID_PACKAGE_NAME}\")
target_link_libraries(libwg-quick.so -ldl)
file(GLOB WG_SOURCES wireguard-tools/src/*.c libmnl/src/*.c ndk-compat/compat.c)
add_executable(libwg.so ${WG_SOURCES})
target_include_directories(libwg.so PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/wireguard-tools/src/uapi/" "${CMAKE_CURRENT_SOURCE_DIR}/wireguard-tools/src/")
target_compile_options(libwg.so PUBLIC -O3 -std=gnu11 -D_GNU_SOURCE -idirafter "${CMAKE_CURRENT_SOURCE_DIR}/libmnl/include/" -include ${CMAKE_CURRENT_SOURCE_DIR}/ndk-compat/compat.h -DHAVE_VISIBILITY_HIDDEN -DRUNSTATEDIR=\"/data/data/${ANDROID_PACKAGE_NAME}/cache\" -Wno-pointer-arith -Wno-unused-parameter)
add_custom_target(libwg-go.so WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/libwg-go" COMMENT "Building wireguard-go" VERBATIM COMMAND make
ANDROID_ARCH_NAME=${ANDROID_ARCH_NAME}
ANDROID_C_COMPILER=${ANDROID_C_COMPILER}
ANDROID_TOOLCHAIN_ROOT=${ANDROID_TOOLCHAIN_ROOT}
ANDROID_LLVM_TRIPLE=${ANDROID_LLVM_TRIPLE}
ANDROID_SYSROOT=${ANDROID_SYSROOT}
ANDROID_PACKAGE_NAME=${ANDROID_PACKAGE_NAME}
CFLAGS=${CMAKE_C_FLAGS}\ -Wno-unused-command-line-argument
LDFLAGS=${CMAKE_SHARED_LINKER_FLAGS}\ -fuse-ld=gold
DESTDIR=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
BUILDDIR=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/../generated-src
)
# Hack to make it actually build as part of the default target
add_dependencies(libwg.so libwg-go.so)
project structure:
i'm using Android studio 3.5.3 and gradle 5.4.1 in ubuntu 18.04.
NDK(side by side) , LLDB and CMake also installed. however I see this warning(not error) in event log : NDK Resolution Outcome: Project settings: Gradle model version=5.4.1, NDK version is UNKNOWN in all projects. even those that not using ndk.
in local.properties I defined :
ndk.dir=/home/hadi/Dev/Android/android-sdk/ndk/21.0.6113669
sdk.dir=/home/hadi/Dev/Android/android-sdk
Can anyone help me?
this repository have some sub modules and must clone with extra options.
as in readme file in github page mentioned, I must clone project by these commands:
$ git clone --recurse-submodules https://git.zx2c4.com/wireguard-android
$ cd wireguard-android
$ ./gradlew assembleRelease

Can't build Kivy project with buildozer and python3crystax

Sorry for possible stupid question, but today I spent ~5 hours trying to build simple apk with Python3, Buildozer and Crystax NDK. I used Buildozer VM, downloaded Crystax ndk 10.3.2, created buildozer.spec as follow on github instruction https://github.com/kivy/buildozer . My buildozer.spec:
title = Cyba app
package.name = cyapp
package.domain = ru.longint
source.dir = .
requirements = python3crystax,kivy
android.ndk_path = ~/.buildozer/crystax-ndk
and few others.
When I run buildozer -v android debug to make first compilation (by the instruction on the Buildozer's wiki), I got next logs:
# 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.18.10 (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 /usr/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
# Apache ANT found at /home/kivy/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/kivy/.buildozer/android/platform/android-sdk-20
# Android NDK found at /home/kivy/.buildozer/crystax-ndk
# Check application requirements
# Run './distribute.sh -l'
# Cwd /home/kivy/Documents/kbs/.buildozer/android/platform/python-for-android
Available modules: android apsw audiostream bidi boost cherrypy c_igraph click cprotobuf cymunk django docutils ecdsa enum34 evdev ffmpeg ffmpeg2 ffpyplayer ffpyplayer_tito flask freetype gevent greenlet harfbuzz hostpython igraph itsdangerous jinja2 jpeg kivent_core kivent_cymunk kivy leveldb libevent libpq libsodium libswift libtorrent libxml2 libxslt libyaml lxml m2crypto markupsafe midistream msgpack mysql_connector netifaces numpy opencv openssl paramiko pil plyer plyvel png polygon protobuf psutil psycopg2 pyasn1 pycrypto pygame pyjnius pylibpd pyopenssl pyparsing pyqrcode python pyyaml sdl setuptools six sqlalchemy sqlite3 storm swift thrift twisted txws werkzeug wokkel zeroconf zope
# Remove directory and subdirectory /home/kivy/Documents/kbs/.buildozer/applibs
# Create directory /home/kivy/Documents/kbs/.buildozer/applibs
# Run 'bash -c "source venv/bin/activate && env"'
# Cwd /home/kivy/Documents/kbs/.buildozer
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
LESSCLOSE=/usr/bin/lesspipe %s %s
XDG_MENU_PREFIX=xfce-
LANG=en_US.UTF-8
GDM_LANG=en_US
DISPLAY=:0.0
ANDROIDAPI=19
GTK_OVERLAY_SCROLLING=0
COLORTERM=truecolor
XDG_VTNR=7
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
VIRTUAL_ENV=/home/kivy/Documents/kbs/.buildozer/venv
MANDATORY_PATH=/usr/share/gconf/xubuntu.mandatory.path
GLADE_CATALOG_PATH=:
XDG_SESSION_ID=c2
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/kivy
USER=kivy
GLADE_MODULE_PATH=:
DESKTOP_SESSION=xubuntu
ANDROIDNDK=/home/kivy/.buildozer/crystax-ndk
DEFAULTS_PATH=/usr/share/gconf/xubuntu.default.path
QT_QPA_PLATFORMTHEME=gtk2
PWD=/home/kivy/Documents/kbs/.buildozer
HOME=/home/kivy
ANDROIDSDK=/home/kivy/.buildozer/android/platform/android-sdk-20
SSH_AGENT_PID=1309
QT_ACCESSIBILITY=1
XDG_SESSION_TYPE=x11
XDG_DATA_DIRS=/usr/share/xubuntu:/usr/share/xfce4:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop:/usr/share
PACKAGES_PATH=/home/kivy/.buildozer/android/packages
XDG_SESSION_DESKTOP=xubuntu
GLADE_PIXMAP_PATH=:
CLUTTER_BACKEND=x11
VTE_VERSION=4402
SHELL=/bin/bash
TERM=xterm-256color
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_CURRENT_DESKTOP=XFCE
QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1
SHLVL=2
XDG_SEAT=seat0
LANGUAGE=en_US:
ANDROIDNDKVER=r9c
WINDOWID=67112367
GDMSESSION=xubuntu
LOGNAME=kivy
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
XDG_RUNTIME_DIR=/run/user/1000
XAUTHORITY=/home/kivy/.Xauthority
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_CONFIG_DIRS=/etc/xdg/xdg-xubuntu:/etc/xdg:/etc/xdg
PATH=/home/kivy/Documents/kbs/.buildozer/venv/bin:/home/kivy/.buildozer/android/platform/apache-ant-1.9.4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
PS1=(venv)
SESSION_MANAGER=local/kivyvm:#/tmp/.ICE-unix/1327,unix/kivyvm:/tmp/.ICE-unix/1327
LESSOPEN=| /usr/bin/lesspipe %s
_=/usr/bin/env
# Install distribute
# Run 'curl http://python-distribute.org/distribute_setup.py | venv/bin/python'
# Cwd /home/kivy/Documents/kbs/.buildozer
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:02:10 --:--:-- 0curl: (7) Failed to connect to python-distribute.org port 80: Connection timed out
# Install requirement python3crystax in virtualenv
# Run 'pip install --target=/home/kivy/Documents/kbs/.buildozer/applibs python3crystax'
# Cwd /home/kivy/Documents/kbs/.buildozer
Collecting python3crystax
Could not find a version that satisfies the requirement python3crystax (from versions: )
No matching distribution found for python3crystax
# Command failed: pip install --target=/home/kivy/Documents/kbs/.buildozer/applibs python3crystax
#
# 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
And here's my questions:
1)What is python3crystax literally? Is a pip package, utility, file or what?
2)Must i download python3crystax manually and where i can to download this?
3)What i did wrong?
UPD:
I found this question and tried buildozer -v android_new debug
Got this (log_level in buildozer.spec is 2):
# 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.18.10 (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 /usr/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
# Apache ANT found at /home/kivy/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/kivy/.buildozer/android/platform/android-sdk-20
# Android NDK found at /home/kivy/.buildozer/crystax-ndk
# Check application requirements
# Check garden requirements
# Compile platform
# Run 'python -m pythonforandroid.toolchain --color=always --storage-dir=/home/kivy/Documents/kbs/.buildozer/android/platform/build create --dist_name=cyapp --bootstrap=sdl2 --requirements=python3crystax,kivy --arch armeabi-v7a --copy-libs'
# Cwd /home/kivy/Documents/kbs/.buildozer/android/platform/python-for-android-master
[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
[WARNING]: NDK version was set as r10.3.2, but checking the NDK dir claims it is 10.3.2.
[WARNING]: The build will try to continue, but it may fail and you should check that your setting is correct.
[WARNING]: If the NDK dir result is correct, you don't need to manually set the NDK ver.
[INFO]: Using Crystax NDK r10.3.2
[INFO]: Found virtualenv at /usr/local/bin/virtualenv
[INFO]: ccache is missing, the build will not be optimized in the future.
[WARNING]: include directory doesn't exist: /home/kivy/.buildozer/crystax-ndk/sysroot/usr/include/arm-linux-androideabi
[INFO]: Found the following toolchain versions: ['4.9', '5', 'clang3.6', 'clang3.7']
[INFO]: Picking the latest gcc toolchain, here 5
[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: python -m pythonforandroid.toolchain --color=always --storage-dir=/home/kivy/Documents/kbs/.buildozer/android/platform/build create --dist_name=cyapp --bootstrap=sdl2 --requirements=python3crystax,kivy --arch armeabi-v7a --copy-libs
#
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2
I see some weird string in logs. I really have not this path in Crystax ndk folder.
[WARNING]: include directory doesn't exist: /home/kivy/.buildozer/crystax-ndk/sysroot/usr/include/arm-linux-androideabi
Download and extract the Crystax NDK somewhere e.g. /opt/
Make sure the following lines are in your buildozer.spec file.:
Require python3crystax:
requirements = python3crystax,kivy
Point to the directory where you extracted the crystax-ndk:
android.ndk_path = /opt/crystax-ndk-10.3.2

Building pjsip for x86

I want to build pjsip for x86 architecture. I am following this link. In the instructions,
Building PJSIP
Just run:
$ cd /path/to/your/pjsip/dir
$ export ANDROID_NDK_ROOT=/path_to_android_ndk_dir
$ ./configure-android
$ make dep && make clean && make
Notes:
It will build armeabi target, to build for other targets such as arm64-v8a, armeabi-v7a, x86, instead of just './configure-android', specify the target arch in TARGET_ABI and run it with --use-ndk-cflags, for example:
TARGET_ABI=armeabi-v7a ./configure-android --use-ndk-cflags
Also you should adjust ​Application.mk and ​library packaging path (see also #1803).
Are they referring Application.mk in pjsua application?
Yes. There is link in ticket #1803 on changeset 5056:
https://trac.pjsip.org/repos/changeset/5056
Android.mk and Application.mk you can find here: your-pjsip-root-dir/pjsip-apps/src/pjsua/android/jni/Application.mk

Categories

Resources