Skip to content

Commit 965ffe2

Browse files
committed
Merge bitcoin/bitcoin#23757: [build] Android: fix GUI not loading on Qt 5.15
27f353d build, android: Fix Android GUI not loading on Qt 5.15 (Igor Cota) 6fc5c77 build, qt: use static QAndroidPlatformIntegrationPlugin (Igor Cota) Pull request description: PR moved from bitcoin-core#504 as it escaped the confines of `src/qt`. ACKs for top commit: hebasto: re-ACK 27f353d promag: utACK 27f353d Tree-SHA512: 4b6e6b2fb1923b89934f11caa8c05c6f340881689273f0c08916144e623f03fd5b781f1a53af83f6e87dce211fe02a1cb87e5943d13811c791cc8aa458184d9f
2 parents b67115d + 27f353d commit 965ffe2

File tree

7 files changed

+26
-7
lines changed

7 files changed

+26
-7
lines changed

src/Makefile.qt.include

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,7 @@ bitcoin_qt_apk: FORCE
394394
cp $(dir $(lastword $(CC)))../sysroot/usr/lib/$(host_alias)/libc++_shared.so $(APK_LIB_DIR)
395395
tar xf $(QT_BASE_PATH) -C qt/android/src/ $(QT_BASE_TLD)src/android/jar/src --strip-components=5
396396
tar xf $(QT_BASE_PATH) -C qt/android/src/ $(QT_BASE_TLD)src/android/java/src --strip-components=5
397-
tar xf $(QT_BASE_PATH) -C qt/android/res/ $(QT_BASE_TLD)src/android/java/res --strip-components=5
398-
cp qt/bitcoin-qt $(APK_LIB_DIR)/libbitcoin-qt.so
397+
cp qt/bitcoin-qt $(APK_LIB_DIR)/libbitcoin-qt_$(ANDROID_ARCH).so
399398
cd qt/android && gradle wrapper --gradle-version=6.6.1
400399
cd qt/android && ./gradlew build
401400

src/Makefile.qttest.include

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ if ENABLE_ZMQ
5252
qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
5353
endif
5454
qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) \
55-
$(LIBLEVELDB_SSE42) $(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \
55+
$(LIBLEVELDB_SSE42) $(LIBMEMENV) $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) \
5656
$(QR_LIBS) $(BDB_LIBS) $(MINIUPNPC_LIBS) $(NATPMP_LIBS) $(LIBSECP256K1) \
5757
$(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(SQLITE_LIBS)
5858
qt_test_test_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS)

src/qt/android/.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
/.gradle
22
/build
3-
/gradle/wrapper
3+
/gradle
44
/gradlew*
55
/libs
6-
/res/layout
7-
/res/values*
86
/src/org/kde
97
/src/org/qtproject

src/qt/android/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
<meta-data android:name="android.app.background_running" android:value="true"/>
3333
<meta-data android:name="android.app.auto_screen_scale_factor" android:value="true"/>
3434
<meta-data android:name="android.app.extract_android_style" android:value="default"/>
35-
</activity>
35+
<meta-data android:name="android.app.load_local_libs_resource_id" android:resource="@array/load_local_libs"/>
36+
</activity>
3637

3738
</application>
3839
</manifest>

src/qt/android/res/values/libs.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<array name="load_local_libs">
4+
<item>
5+
arm64-v8a;libbitcoin-qt_arm64-v8a.so
6+
</item>
7+
<item>
8+
armeabi-v7a;libbitcoin-qt_armeabi-v7a.so
9+
</item>
10+
<item>
11+
x86_64;libbitcoin-qt_x86_64.so
12+
</item>
13+
<item>
14+
x86;libbitcoin-qt_x86.so
15+
</item>
16+
</array>
17+
</resources>

src/qt/bitcoin.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ Q_IMPORT_PLUGIN(QWindowsVistaStylePlugin);
6565
#elif defined(QT_QPA_PLATFORM_COCOA)
6666
Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin);
6767
Q_IMPORT_PLUGIN(QMacStylePlugin);
68+
#elif defined(QT_QPA_PLATFORM_ANDROID)
69+
Q_IMPORT_PLUGIN(QAndroidPlatformIntegrationPlugin)
6870
#endif
6971
#endif
7072

src/qt/test/test_main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Q_IMPORT_PLUGIN(QXcbIntegrationPlugin);
3434
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin);
3535
#elif defined(QT_QPA_PLATFORM_COCOA)
3636
Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin);
37+
#elif defined(QT_QPA_PLATFORM_ANDROID)
38+
Q_IMPORT_PLUGIN(QAndroidPlatformIntegrationPlugin)
3739
#endif
3840
#endif
3941

0 commit comments

Comments
 (0)