depends : aarch64 android including QT #16568

issue BlockMechanic openend this issue on August 8, 2019
  1. BlockMechanic commented at 8:58 am on August 8, 2019: contributor

    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

  2. fanquake added the label Build system on Aug 8, 2019
  3. emilengler commented at 8:41 am on August 9, 2019: contributor
    Could you post your ./configure arguments
  4. BlockMechanic renamed this:
    depends : Add full android support including QT
    depends : aarch64 android including QT
    on Aug 11, 2019
  5. Sjors commented at 11:39 am on August 15, 2019: member
    @greenaddress have you ever tried this for ABCore?
  6. BlockMechanic commented at 12:54 pm on August 15, 2019: contributor
    @Sjors I managed to go all the way to making an apk for arm64-v8a just a few hours ago. I am trying to work out arm-v7a now to ensure that should this be accepted , Bitcoin core can be released on the google play market. How goes your iOS effort ?
  7. greenaddress commented at 9:06 pm on August 18, 2019: contributor

    @sjors it’s not very different from what bitcoin_ndk for ABCore does, sets up toolchain and calls depends - but it’s not enough to support aarch64 - google as of recently mandates all supported platform if you provide native binaries/libraries - so that’s armv7a, aarch64, 686 and amd64 - when you get to 32 bit builds you’ll hit an issue with libevent that requires either latest stable libevent or a patch

    for details see https://github.com/greenaddress/bitcoin_ndk

  8. BlockMechanic commented at 4:20 am on August 19, 2019: contributor

    ~I think i’ve bumped into a 32bit issue with leveldb whlie going for arm-v7a :- :-1: error: error: /home/user/bitcoin/src/leveldb/libleveldb.a(leveldb_libleveldb_a-env_posix.o): requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC~

    Figured it out, so i finally have two apks built.

    Strange thing is that android studio does not seem to have system images for v7 and v8 above api 25. (a lot of the code requires api lv 28 if you do not want to patch too many things)

    Take note i was using Qt 5.12.4 , ndk 20 and gradle 5.x. I think builds with earlier versions are probably possible but not advisable from my POV , namely because i did not have to patch much and have reached a point in the process where i can easily produce apks for armv7a and arm64-v8a.

    Now if i can reliably test the apks, i’ll create a pull request and then maybe join in the effort to get an iOS build.

  9. greenaddress commented at 1:47 pm on September 5, 2019: contributor
    Qt as is in core can’t be used on Android as far as I know - I wouldn’t add qt to the build deps if unnecessary/unusable for now
  10. BlockMechanic commented at 3:52 pm on September 9, 2019: contributor

    Screenshot from 2019-09-09 17-51-21

    I have it running now :) ,now I need to mod to make it more touch friendly. Anyone interested in working on this with me?

  11. GCastilho commented at 8:18 pm on September 9, 2019: none

    I think your progress so far is awesome

    But can it sync with the network? And how does that work? (SPV, full sync, etc)

  12. BlockMechanic commented at 7:32 am on September 10, 2019: contributor
    It can though not advisable using mobile data. With spv option, core reference client becomes viable and available on mobile.
  13. Sjors commented at 9:19 am on September 16, 2019: member

    Don’t worry about looks too much. As long as everything works, we can just review and merge the build system changes. Your PR should include instructions or link to a Github project, so others can reproduce the GUI build during review.

    Ideally you would use the same QT version 5.9.8 as depends. If that’s not (yet) possible, perhaps you can add qt-android.mk with the more recent version you need? Eventually we’ll catch up and unite them. @theuni thoughts?

  14. icota commented at 10:10 am on September 16, 2019: contributor

    Awesome work @BlockMechanic! Would be great to have your recipe leading up to a working APK. I followed (some of) your steps to build 5.9.8 but got stuck on:

    0ERROR: Feature 'system-freetype' was enabled, but the pre-condition 'features.freetype && libs.freetype' failed.
    1
    2ERROR: Feature 'fontconfig' was enabled, but the pre-condition '!config.win32 && !config.darwin && features.system-freetype && libs.fontconfig' failed.
    

    When we figure this out I can add the necessary changes and patches to PR 16110

  15. icota commented at 12:43 pm on September 16, 2019: contributor
    I managed to build it by disabling fontconfig (which I belive serves no purpose on Android). I’ve rebased and updated #16110.
  16. BlockMechanic commented at 2:09 pm on September 16, 2019: contributor
    Awesome i actually have regular builds already and had started working on modifying the wallet to for small screens and also a material theme to match android standards. I will have time in the morning tomorrow and will fork your branch and make a PR with my changes.
  17. icota commented at 3:18 pm on September 16, 2019: contributor
    @BlockMechanic what a coincidence. I have made a “mobile” PR as well but I’m aiming to use QtQuick rather than QtWidgets. But I think we are mostly on the same page - looking forward to your PR.
  18. laanwj added the label Android on Sep 30, 2019
  19. BlockMechanic commented at 3:20 am on December 27, 2020: contributor
    Lol, This is sooooo SOLVED.
  20. BlockMechanic closed this on Dec 27, 2020

  21. GCastilho commented at 3:36 am on December 27, 2020: none
    It is? Why?
  22. BlockMechanic commented at 3:49 am on December 27, 2020: contributor
    aarch64 builds + Qt are already a thing.
  23. DrahtBot locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-07-01 07:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me