purpose of android folder?
-
You have to have it by yourself or from qt creator. I made it by myself and set all build files(for android and linux with qmake and cmake) under one dir(s)=buildfiles.
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/../android <==in qmake
set( ANDROID_PACKAGE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/buildfiles/android CACHE INTERNAL "" ) <==in cmakeContents in it are: gradle stuff(generated by qtcreator), AndroidManifest.xml, app icon settings, your interface to android Java, etc.
-
@JoeCFD when you say "build files" does that mean your source files (.qml, .svg, etc)?
I have a similar entry in the CMakeLists.txt file from the example, but when I try to run, I get this error:
W libappaccelbubble_x86_64.so: QQmlApplicationEngine failed to load component W libappaccelbubble_x86_64.so: qrc:/bubble/main.qml: No such file or directory
-
@JoeCFD the example I cited in my original post has this in its CMakeLists.txt file:
set_property(TARGET appaccelbubble APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/android )
If I build the example as-is, I get the error I posted. If I comment out the "/android" it works.
I'm asking why that is.
-
@mzimmers sorry I did not realize this one QT_ANDROID_PACKAGE_SOURCE_DIR was introduced in Qt6. Mine is ANDROID_PACKAGE_SOURCE_DIR in qt 5 apps. It is the case that QT_ANDROID_PACKAGE_SOURCE_DIR does not need /android. I have not started to use Qt6.
-
Oh...so this is something of a Qt 5 artifact? OK, that makes sense...I guess whoever maintains the Qt examples missed this (I did pull it from the Qt 6 examples).
So...now, let's turn this question around: let's say I want to use this folder, so all those Android files don't clutter up my main folder. How do I enable that?
-
@mzimmers You can put it anywhere, but set its path with QT_ANDROID_PACKAGE_SOURCE_DIR. You do not need it now because all its contents may have been copied into android-build. Where does your app get AndroidManifest.xml if your build dir is removed? This dir is part of your android app.