You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/build-android.md
+212-1
Original file line number
Diff line number
Diff line change
@@ -22,4 +22,215 @@ This is an example command for a default build with no disabled dependencies:
22
22
23
23
## Building and packaging
24
24
25
-
After the depends are built configure with one of the resulting prefixes and run `make && make apk` in `src/qt`.
25
+
After the depends are built configure with one of the resulting prefixes and run `make && make apk` in `src/qt`.
26
+
27
+
# Bitcoin Core WSL Ubuntu Android QML GUI
28
+
29
+
This guide will walk you through the steps to build Bitcoin Core QML APKs using WSL Ubuntu 22.04 on Windows 11.
30
+
31
+
## Prerequisites
32
+
33
+
1. Install WSL Ubuntu 22.04 on Windows 11. You can find a comprehensive guide [here](https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-11-with-gui-support#1-overview).
34
+
35
+
## Installation Steps
36
+
37
+
### Step 1: Update WSL Ubuntu 22.04
38
+
39
+
After installing Ubuntu, run the following commands to update it:
40
+
41
+
```bash
42
+
sudo apt update
43
+
sudo apt upgrade
44
+
```
45
+
46
+
### Step 2: Install Bitcoin Core Dependencies
47
+
48
+
Next, install the necessary Bitcoin Core dependencies with the following commands:
Follow the instructions below to install Android Studio and Android NDK on your system:
63
+
64
+
1. Install OpenJDK-11-JDK:
65
+
66
+
```bash
67
+
sudo apt install openjdk-11-jdk
68
+
```
69
+
70
+
2. Verify the installation by checking the java version:
71
+
72
+
```bash
73
+
java --version
74
+
```
75
+
76
+
3. Install Android Studio using Snap:
77
+
78
+
```bash
79
+
sudo snap install android-studio --classic
80
+
```
81
+
82
+
4. Run Android Studio:
83
+
84
+
```bash
85
+
android-studio
86
+
```
87
+
88
+
You can also follow the full installation guide for Android Studio and Android NDK [here](https://linuxhint.com/install-android-studio-ubuntu22-04/).
89
+
90
+
### Step 4: Install Android NDK
91
+
92
+
To install Android NDK:
93
+
94
+
1. With a project open in Android Studio, click `Tools > SDK Manager`.
95
+
2. Click the `SDK Tools` tab.
96
+
3. Select the `NDK (Side by side)` and `CMake` checkboxes.
97
+
4. Click `OK`.
98
+
5. A dialog box will tell you how much space the NDK package consumes on disk.
99
+
6. Click `OK`.
100
+
7. When the installation is complete, click `Finish`.
101
+
102
+
You can find the full guide [here](https://developer.android.com/studio/projects/install-ndk).
103
+
104
+
### Step 5: Check Android Device Architecture
105
+
106
+
Before you proceed, ensure you check your Android Device's hardware architecture. Use usbip and adb for this. Detailed guide can be found [here](https://www.xda-developers.com/wsl-connect-usb-devices-windows-11/).
107
+
108
+
1. Connect your Android device to your PC and enable USB debugging in Developer Options.
109
+
2. Once usbip is installed, list all USB devices connected to your PC by running the following command as Administrator in `cmd`:
110
+
111
+
```bash
112
+
usbipd wsl list
113
+
```
114
+
115
+
3. Note down the `BUSID` of the device you want to connect to WSL. Then run the following command, replacing `<busid>` with the `BUSID` of your device:
116
+
117
+
```bash
118
+
usbipd wsl attach --busid <busid>
119
+
```
120
+
121
+
4. Install adb:
122
+
123
+
```bash
124
+
sudo apt install adb
125
+
```
126
+
127
+
5. Check the hardware architecture of your device:
128
+
129
+
```bash
130
+
adb shell getprop ro.product.cpu.abi
131
+
```
132
+
133
+
6. Note down the architecture (arm64-v8a, armeabi-v7a, x86_64, x86).
7. Verify the installation by checking the Gradle version:
176
+
177
+
```bash
178
+
gradle -v
179
+
```
180
+
181
+
You can follow the full guide to install Gradle [here](https://linuxhint.com/installing_gradle_ubuntu/).
182
+
183
+
### Step 7: Build APKs
184
+
185
+
Before building the APKs, run the following commands:
186
+
187
+
```bash
188
+
PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g') # strip out problematic Windows %PATH% imported var
189
+
sudo bash -c "echo 0 > /proc/sys/fs/binfmt_misc/status" # Disable WSL support for Win32 applications.
190
+
```
191
+
192
+
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).
193
+
194
+
Now, you can build the APKs using the guide found [here](https://github.com/bitcoin-core/gui-qml/blob/main/doc/build-android.md).
195
+
196
+
if you get an error like this:
197
+
198
+
```bash
199
+
global/qlogging:1296:13 n = backtrace(...
200
+
```
201
+
202
+
find the file qlogging.cpp (depends/.../work/.../global/) then you need to edit the function with the following:
0 commit comments