-
Notifications
You must be signed in to change notification settings - Fork 86
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
Chap05 runs on desktop but not on mobile. #13
Comments
Hello Roye, The first edition of the book was written for Qt 5.7 and the second edition wad updated for Qt 5.11. I think you encounters issues because you are using a Qt version >= 5.14. Starting Qt version 5.14 , Qt for Android now use Android Clang Multi-Abi that generate multi ABI binaries. And the name of a library is postfix with the name of the ABI (armeabi-v7a, amr6-v8a, x86, x86_64, ...).
# Removed part. Qt version 5.11 (single ABI)
# LIBS += -L$$OUT_PWD/../gallery-core/ -lgallery-core
# contains(ANDROID_TARGET_ARCH,x86) {
# ANDROID_EXTRA_LIBS = \
# $$[QT_INSTALL_LIBS]/libQt5Sql.so
# }
# Updated part. >= Qt version 5.14 (multi ABI)
android: {
LIBS += -L$$OUT_PWD/../gallery-core/ -lgallery-core_$$ANDROID_ABIS
ANDROID_EXTRA_LIBS = \
$$[QT_INSTALL_LIBS]/libQt5PrintSupport_$${ANDROID_ABIS}.so \
$$[QT_INSTALL_LIBS]/libQt5Sql_$${ANDROID_ABIS}.so \
$$OUT_PWD/../gallery-core/libgallery-core_$${ANDROID_ABIS}.so \
} else {
LIBS += -L$$OUT_PWD/../gallery-core/ -lgallery-core
}
You can now check the generated APK, you hould get the "libgallery-mobile_armeabi-v7a.so" file in the APK. The fix above will correct your compilation issue with >=Qt 5.14 for Android. But I guess you will get others issues and it can require some time to update a source code software to Qt version to another one. If you update it to a recent Qt version, feel free to create a PR on the second edition github repo (this first edition github is deprecated and not updated) : https://github.com/PacktPublishing/Mastering-Qt-5-Second-Editon |
Love the book. It teachs me a lot.
I'm trying to run the chap05 app on an Android device. It fails to start due to the followings:
Looking in the apk file, and listing all libs, the libgallery-core_armeabi-v7a.so is missing.
Two questions:
Thank you,
Roye Avidor
The text was updated successfully, but these errors were encountered: