Concept Based on work from :- #16110 aarch64 builds bitcoind and following this example :- #13604 , I’m trying to build bitcoin core to use on android devices, like phones and tablets. Recent devices seem to have adaquate power and storage. In some cases users may also have repurposed devices that run android (old laptop etc) and wish to run bitcoin core.
Using make HOST=aarch64-linux-android ANDROID_API_LEVEL=28 ANDROID_TOOLCHAIN_BIN=/home/user/Downloads/bitcoin/depends/android_ndk/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin ANDROID_SDK=/home/user/android-sdk-linux ANDROID_NDK=/home/user/Downloads/bitcoin/depends/android_ndk/android-ndk-r20
And depends/hosts/android.mk
has this :-
android_AR=$(ANDROID_TOOLCHAIN_BIN)/$(HOST)-ar
android_CXX=$(ANDROID_TOOLCHAIN_BIN)/$(HOST)$(ANDROID_API_LEVEL)-clang++
android_CC=$(ANDROID_TOOLCHAIN_BIN)/$(HOST)$(ANDROID_API_LEVEL)-clang
android_RANLIB=$(ANDROID_TOOLCHAIN_BIN)/$(HOST)-ranlib
ANDROID_SDK=$(ANDROID_SDK)
ANDROID_NDK=$(ANDROID_NDK)
NDK_VERSION=4.9
ANDROID_API_LEVEL=$(ANDROID_API_LEVEL)
I’ve added qt_android_packages=qt
to depends/packages/packages.mk
and $(package)_config_opts_aarch64_android = -xplatform android-clang -android-sdk $(ANDROID_SDK) -android-ndk $(ANDROID_NDK) -android-ndk-platform android-$(ANDROID_API_LEVEL) -device-option CROSS_COMPILE="$(host)-" -egl -qpa xcb -no-eglfs -opengl es2 -system-freetype -fontconfig -L $(host_prefix)/lib -I $(host_prefix)/include
to depends/packages/qt.mk
I also created a qmake.conf that resolves the problem mentioned here :- https://forum.qt.io/topic/103713/error-cannot-find-lc-qt-5-12-android/14 and here :- https://github.com/pocoproject/poco/issues/2491
Errors
ERROR: Feature 'system-freetype' was enabled, but the pre-condition 'features.freetype && libs.freetype' failed.
ERROR: Feature 'fontconfig' was enabled, but the pre-condition '!config.win32 && !config.darwin && features.system-freetype && libs.fontconfig' failed.
This issue is related to :- #13495 and https://github.com/bitcoin/bitcoin/pull/13696