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

Fix build issues and create APK for the Android with Qt6 #65

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hancerli
Copy link

@hancerli hancerli commented Apr 8, 2024

Build with Qt 6.7.0 and tested on;

  • macOS 14 (arm64)
  • Android 8
  • Android 14

@jbagg
Copy link
Owner

jbagg commented Apr 10, 2024

Hi, I have not used cmake from either the command line or with QtCreator to build an android target. I'm able to build the exe in QtCreator and from the cmd line, but not the apk. I cloned your fork and opened CMakeList.txt in QtCreator. build output is
09:41:22: Starting: "/usr/bin/cmake" --build /tmp/QtZeroConf/build-example-Android_Qt_6_5_1_6_5_1_Android_arm_Clang_armeabi_v7a-Debug --target all [1/5 5.7/sec] Automatic MOC and UIC for target QtZeroConfExample [2/5 2.2/sec] Building CXX object CMakeFiles/QtZeroConfExample.dir/QtZeroConfExample_autogen/mocs_compilation.cpp.o [3/5 3.2/sec] Building CXX object CMakeFiles/QtZeroConfExample.dir/main.cpp.o [4/5 3.7/sec] Building CXX object CMakeFiles/QtZeroConfExample.dir/window.cpp.o [5/5 4.5/sec] Linking CXX executable QtZeroConfExample 09:41:23: The process "/usr/bin/cmake" exited normally. 09:41:23: Cannot set up "Build Android APK", not building an APK. Error while building/deploying project QtZeroConfExample (kit: Android Qt 6.5.1 (6.5.1-Android-arm) Clang armeabi-v7a) When executing step "Build Android APK"

@hancerli
Copy link
Author

You're using Qt 6.5.1 but I added Android support only for 6.6.x and later. Should I fail the Cmake (configure) if it's lower than that?

@jbagg
Copy link
Owner

jbagg commented Apr 10, 2024

template T QJniObject::object() was not added until Qt6.7, so your change would require 6.7 or later. This commit would break Qt 6.0 to 6.6.3. Does the QtZeroConf library not compile in Qt 6.7? I am not able to test as Qt 6.7 does not build on Debian 12; 6.6.3 does build, and QtZeroConf compiles fine with 6.6.3 as is.

@hancerli
Copy link
Author

No it didn't built. Let me check.

@hancerli
Copy link
Author

Fix the build issues.

@jbagg
Copy link
Owner

jbagg commented Apr 11, 2024

It doesn't seem right that Qt 6.7 would not compile code that Qt 6.6 does. I suspect something is still wrong. If you want to go ahead with this change, can you make the commits atomic? It is unclear to me why the changes in CMakeList are necessary to fix compiling and why openssl is needed. QtZeroConf and the example both compile with cmake and qmake as is.

@jbagg jbagg mentioned this pull request Jun 28, 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.

2 participants