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
Qt: Add Android packaging support #17227
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
Concept ACK, nice ! |
fc5bea0
to
d5f83c5
Compare
Rebased, squashed, added instructions under |
d5f83c5
to
533c18d
Compare
IMO final would be a gitian descriptor ;) |
@icota Friendly ping for a rebase. |
Thank you @adamjonas. Rebased. |
@icota Could you pull in maflcko@a0b441b to shave off a few kB off of the compressed images? |
Absolutely. Thanks @MarcoFalke |
Oh, you'll have to squash it. Otherwise git will keep track of both versions, thus doubling the size. |
Done. |
Awesome, will test this out. |
utACK a818b2c |
Concept ACK. Not sure how this can be tested in ci. I guess it needs the android dev kit? |
Yep it needs the SDK. Travis seems to support this. |
Unfortunately (or luckily) we can't use travis' packages. We use our own ci setup in The sdkmanager is a zip file that can be downloaded, though. And then a one-liner like
should do the rest. |
I'd like to give this a try in the main branch (even without CI support). If it gets unmaintained, a revert is likely. |
cr ACK 246774e |
Code review ACK 246774e |
@icota Thanks for working on this. Its merged :) #16883 looks interesting except one comment from @promag , my younger brother is also good with Android development but Kotlin. Will share things with him after testing. |
Seeing CI failures in ARM64 Android APK [bionic] build that might be related to this: https://cirrus-ci.com/task/5511109198217216?command=ci#L4420
|
@ryanofsky Yes, and this line is the culprit: bitcoin/src/Makefile.qt.include Line 382 in 9217f9f
Is Cirrus perhaps wiping |
I'm able to reproduce a similar error locally so I don't think it is a cirrus issue. |
I can't reproduce locally (unless I manually delete fails when run last: succeds otherwise: I'm drawing a blank here and I am also fine with disabling the CI APK build for the time being. |
Trying to fix the issue in #21537 |
Fixed by @MarcoFalke in #21541 |
@@ -378,6 +378,20 @@ bitcoin_qt_clean: FORCE | |||
|
|||
bitcoin_qt : qt/bitcoin-qt$(EXEEXT) | |||
|
|||
APK_LIB_DIR = qt/android/libs/$(ANDROID_ARCH) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the content of the qt/android
directory be a subject of the cleanup in make clean
or make distclean
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should 👍
final File bitcoinDir = new File(getFilesDir().getAbsolutePath() + "/.bitcoin"); | ||
if (!bitcoinDir.exists()) { | ||
bitcoinDir.mkdir(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code prevents the Intro dialog from showing at the first startup. Is it intended? If yes, why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH I don't remember why I did this. Did you try without it? Maybe the dialog was showing incorrectly?
I didn't at the time but I realise now that this makes using external storage impossible. Possibly related to bitcoin-core/gui#496
After bumping Qt to 5.15.2 (#23489) this stuff seems required to be updated to work properly. @icota Could you have a look into this please? |
https://www.kdab.com/qt-for-android-better-than-ever-before/ seems related. |
Thanks for letting me know @hebasto. Attempting to fix the issues in bitcoin-core/gui#504 |
merge bitcoin#17227...bitcoin#23580: Qt 5.12.10
This PR is the third and final piece of the basic Android support puzzle - it depends on #16110 and is related to #16883. It introduces an
android
directory underqt
and a simple way to build an Android package ofbitcoin-qt
:make && make apk
insrc/qt
The resulting APK files will be in
android/build/outputs/apk
. You can install them manually or with adb. One can also open theandroid
directory in Android Studio for that integrated development and debugging experience.BitcoinQtActivity
is your starting point.Under the hood makefile
apk
target:bitcoin-qt
binary tolibbitcoin-qt.so
and copies it over to a folder underandroid/libs
depending on which prefix and corresponding ABIbitcoin-qt
was built forlibc++_shared.so
from the Android NDK and puts in the same place. It must be included in the APKqtbase
archive independs/sources
toandroid/src
There is also just a tiny bit of
ifdef
'd code to make the Qt Widgets menus usable. It's not pretty but it works and is a stepping stone towards #16883.