Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT: WSL-Ubuntu-Android Build Guide #366

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

D33r-Gee
Copy link
Contributor

@D33r-Gee D33r-Gee commented Sep 12, 2023

This is an updated version of PR #351
It has been rebased and the WSL Ubuntu Android install guide has been added to build-android.md
Let me know if there are any issues

@D33r-Gee
Copy link
Contributor Author

Rebased main, deleted WSL_APK_INSTALL.md and modified build-android.md so the wsl guide can be found there. Let me know if there's anything that needs to be updated @jarolrod

@hebasto
Copy link
Member

hebasto commented Sep 13, 2023

Please add PR description, update PR title, fix linter issues and clean commit history.

@D33r-Gee D33r-Gee changed the title Rebase was successful. modified build-android.md WSL-Ubuntu-Android Build Guide Sep 13, 2023
@D33r-Gee
Copy link
Contributor Author

Please add PR description, update PR title, fix linter issues and clean commit history.

Took care of the above.
Re: clean commit history, please let me know if that's the way to do it or if you'd prefer a different approach?

Copy link
Contributor

@pablomartin4btc pablomartin4btc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK

I'll try to validate the instructions following them and checking the built is correct. Is this exclusive to WSL or can be done on Ubuntu 22.04.

Re: clean commit history, please let me know if that's the way to do it or if you'd prefer a different approach?

I think there's no need to have so many commits, you could squash them all into only one.

Also, perhaps you need to rebase?

@D33r-Gee
Copy link
Contributor Author

D33r-Gee commented Nov 23, 2023 via email

@D33r-Gee D33r-Gee force-pushed the wsl-install-guide branch 3 times, most recently from 576bbc3 to a4bf253 Compare December 1, 2023 16:25
@D33r-Gee
Copy link
Contributor Author

D33r-Gee commented Dec 1, 2023

Is this exclusive to WSL or can be done on Ubuntu 22.04.

It should work with Ubuntu 22.04 proper.

Squashed the commits and rebased with main

Thanks again for reviewing @pablomartin4btc

Copy link
Contributor

@pablomartin4btc pablomartin4btc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK a4bf253

Sorry, I think the 2nd commit ("Merge branch..." 9ca8bb2) is not necessary, only 1 commit.

I'll try to follow the guide at some point next week and give a deeper review. Thanks for working on this!

@D33r-Gee
Copy link
Contributor Author

D33r-Gee commented Dec 1, 2023

thanks @pablomartin4btc, for taking a look... squashed it down to 1 commit.

I'll try to follow the guide at some point next week and give a deeper review.

Sounds great!

Thanks for working on this!

with pleasure

@hebasto
Copy link
Member

hebasto commented Dec 2, 2023

@D33r-Gee

The diff looks too big (956 files) for a build guide, doesn't it?

@D33r-Gee D33r-Gee closed this Dec 4, 2023
@D33r-Gee D33r-Gee reopened this Dec 4, 2023
@D33r-Gee
Copy link
Contributor Author

D33r-Gee commented Dec 4, 2023

The diff looks too big (956 files) for a build guide, doesn't it?

@hebasto, yes thanks for pointing it out. I didn't do proper house cleaning when synching my fork. It should be resolved now.

Copy link
Contributor

@pablomartin4btc pablomartin4btc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK till Step 4 included

I'll continue and finish it before the end of the next week. Looking forward to have this working and play with it.

Copy link
Contributor

@pablomartin4btc pablomartin4btc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK till Step 6 included, only 1 step left to finish...

I have some minor nits that I'll write them out when I complete the guide entirely.

Copy link
Contributor

@pablomartin4btc pablomartin4btc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK 4523a0f

I've finished the entire guide, sorry it took me a while cos I've checked different devices and had to learn to use the tools.

I tried first with an old tablet (HUAWEI m3 lite 10") with Android 7.0 (API level #24) but the Bitcoin core app crashes due to some missing qt library (checked with adb logcat I needed to install "Ministro II" but it didn't fix it... I'll try later to build a qt bundle from Android Studio and send it to the device).

Secondly I've tried on these (friends and family - 😄 🙏) phones:

Google Pixel 6 (Android 14 - API Level 34)

WhatsApp Image 2023-12-22 at 19 02 28

WhatsApp Image 2023-12-22 at 19 02 29

WhatsApp Image 2023-12-22 at 19 02 29 (1)

WhatsApp Image 2023-12-22 at 19 02 30 (1)

WhatsApp Image 2023-12-22 at 19 02 30 (2)

WhatsApp Image 2023-12-22 at 19 02 29 (2)

Samsung A20 (Android 9 - API Level 28)

WhatsApp Image 2023-12-28 at 12 21 30

HUAWEI Y9 (Android 9 - API Level 28) image

WhatsApp Image 2023-12-23 at 00 34 19

WhatsApp Image 2023-12-23 at 00 36 10

WhatsApp Image 2023-12-23 at 00 48 06

WhatsApp Image 2023-12-23 at 01 13 30

WhatsApp Image 2023-12-23 at 01 52 40

Finally, I've re-built it for my old smart watch...

HUAWEI watch 2 (32 bits, Android 8.0.0, API Level 26)

Screenshot_20231227_223056

screenshot-modified

screenshot2-modified

screenshot4-modified

screenshot5-modified

screenshot6-modified

Screenshot_20231227_223641

Screenshot_20231227_223546

Screenshot_20231227_223355

I've noticed some issues regarding the user experience, layout, etc., on the different platforms/ devices related to QML itself so I'll leave that out of this PR which approach is only the WSL - Ubuntu Android Build Guide.

I think I'd leave this guide open to use both WSL and Ubuntu itself so I'm not sure you need to but in case you do, you can also install usbipd there on Ubuntu.

doc/build-android.md Show resolved Hide resolved
doc/build-android.md Outdated Show resolved Hide resolved

More details on this step can be found [here](https://github.com/bitcoin/bitcoin/blob/master/doc/build-windows.md#compiling-with-windows-subsystem-for-linux).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.g.:

ANDROID_SDK=/home/ubunpolk/Android/Sdk ANDROID_NDK=/home/ubunpolk/Android/Sdk/ndk/26.1.10909125 make -C depends HOST=armv7a-linux-android ANDROID_API_LEVEL=26 ANDROID_TOOLCHAIN_BIN=/home/ubunpolk/Android/Sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/linux-x86_64/bin CC=/home/ubunpolk/Android/Sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi26-clang CXX=/home/ubunpolk/Android/Sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi26-clang++

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the top of this document the example given is:
ANDROID_SDK=/home/user/Android/Sdk ANDROID_NDK=/home/user/Android/Sdk/ndk-bundle make HOST=aarch64-linux-android ANDROID_API_LEVEL=28 ANDROID_TOOLCHAIN_BIN=/home/user/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin

in your example, what do the `CC=...` and `CXX=...` add in terms building the proper depends?

Copy link
Contributor

@pablomartin4btc pablomartin4btc Jan 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it forces to build depends with the proper clang version for the required Android API Level.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah got it... ok so will leave the the extra CC= and CXX= from example to minimize confusion, however if you feel strongly about having them let me know?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to use them in all make calls to ensure the Android API Level for the particular architecture (arm64-v8a, armeabi-v7a, etc), but perhaps it's not required or I'm over-using them, maybe @hebasto can shed some light here.

doc/build-android.md Outdated Show resolved Hide resolved
doc/build-android.md Show resolved Hide resolved
@D33r-Gee
Copy link
Contributor Author

Hi @pablomartin4btc ,

Thanks so much for going through the whole guide and testing it on different devices,,, amazing!

I've finished the entire guide, sorry it took me a while cos I've checked different devices and had to learn to use the tools.

No worries, happy you got through and thanks for suggesting improvements!

I will look them over, test them then update the commit in the coming days...

@D33r-Gee
Copy link
Contributor Author

D33r-Gee commented Jan 8, 2024

@pablomartin4btc , thanks for your reviews and suggestions I've implemented them here 8e20109
Let me know your thoughts and/or if there's anything I missed?

More details on this step can be found [here](https://github.com/bitcoin/bitcoin/blob/master/doc/build-windows.md#compiling-with-windows-subsystem-for-linux).

Now, you can build the APKs using the guide found [here](https://github.com/bitcoin-core/gui-qml/blob/main/doc/build-android.md).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
Now, you can build the APKs using the guide found [here](https://github.com/bitcoin-core/gui-qml/blob/main/doc/build-android.md).
Now, you need to build the dependencies for the specific Android API Level, for which you can follow the guide found [here](https://github.com/bitcoin-core/gui-qml/blob/main/doc/build-android.md).

Maybe that guide above needs to be updated as it shows an example for "a default build with no disabled dependencies", and could display the make -C depends suggested previously. And later below you also specify run make && make apk from src/qt as on the build-android guide.

In my opinion, I'd be more clear on the sub-steps here in Step 7 in order to build the APK and transfer/ install it to the device (including for each the other commands to make it work as the qlogging.cpp update, paths, etc):

  1. build dependencies
  2. configure with proper host
  3. make
  4. make apk
  5. adb install

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea on the having sub-steps

@D33r-Gee
Copy link
Contributor Author

new commit 7687e2c

Added your suggestions @pablomartin4btc

Copy link
Contributor

@pablomartin4btc pablomartin4btc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK 7687e2c

Tested on Ubuntu 22.04 (non-WSL), so I think we can use this guide for both, perhaps you need to identify and separate the steps specifically for WSL (including usage of usbip, which is not required for non-WSL) and that's all I can say, it worked fine for me.

doc/build-android.md Outdated Show resolved Hide resolved
@pablomartin4btc
Copy link
Contributor

I think we can use this guide for both, perhaps you need to identify and separate the steps specifically for WSL (including usage of usbip, which is not required for non-WSL) and that's all I can say, it worked fine for me.

Sorry, what I mentioned above perhaps can be done on a follow-up, apologies if you started doing that already 🙏.

@D33r-Gee
Copy link
Contributor Author

Sorry, what I mentioned above perhaps can be done on a follow-up, apologies if you started doing that already 🙏.

No worries... Apologies for the late response was focused on the AssumeUTXO integration

I think we can use this guide for both...

That's a great idea, once I implement your latest suggestions perhaps it can be merged and we can open a new PR detailing both OSes or we can keep collaborating on this one till we feel it's ready to be merged...

@pablomartin4btc thoughts?

@D33r-Gee
Copy link
Contributor Author

updated and rebased 5b7da4a

Thanks @pablomartin4btc for testing and the suggestions

Copy link
Contributor

@pablomartin4btc pablomartin4btc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re ACK 5b7da4a

perhaps it can be merged and we can open a new PR detailing both OSes or we can keep collaborating on this one till we feel it's ready to be merged...

IMO this PR can be merge as it is, and we can open a new one to incorporate Ubuntu
with some tweaks.

@hebasto
Copy link
Member

hebasto commented Apr 23, 2024

Building for Android is currently broken in the Bitcoin Core master branch. This is the main reason why there have not been syncing to the master branch recently.

I suggest to draft / postpone this PR until CMake + Qt6 are landed to the master branch.

@D33r-Gee
Copy link
Contributor Author

D33r-Gee commented May 1, 2024

I suggest to draft / postpone this PR until CMake + Qt6 are landed to the master branch.

Ah great to know... yes setting this PR to draft then

@D33r-Gee D33r-Gee marked this pull request as draft May 1, 2024 13:55
@D33r-Gee D33r-Gee changed the title WSL-Ubuntu-Android Build Guide DRAFT: WSL-Ubuntu-Android Build Guide May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants