Important: Please read the Qt Code of Conduct -

Desktop app won't build for android

  • I'm very new to Qt and my internship requires me to port an existing desktop application to Android and iOS. I'm using the original Windows machine that the app was developed on. It builds fine on the desktop kit, but for the Android armeabi-v7a kit, this same message gets printed in an endless loop:

    C:\Qt\Qt5.9.2\5.9.2\android_armv7\bin\rcc.exe: File does not exist '\home\<user>\QTBF\build\OslQtCommon\oslqtcommon.qrc'

    I get the same message whenever I run a clean, qmake, or build. I'm using Qt 5.9.2, JDK 1.8, SDK 26.1.1, and NDK r10e.

    Here is the pro file:

    include (common.pri)
    TEMPLATE = subdirs
    SUBDIRS += OslCommon \
    	IcIface \
        OslQtCommon \
    	OslQtGui \
    # note: this line is probably not needed and slowing down builds
    #CONFIG += ordered
    TARGET = Marco
    DEPLOY_TARGET = $$shell_quote($$shell_path($${GLOBAL_BUILD_PATH}/$${TARGET}/$${CONFIGDIR}/$${TARGET}$${TARGET_CUSTOM_EXT}))
    # directory aliases
    OslCommon.subdir = OslCommon
    IcIface.subdir = IcIface
    OslQtCommon.subdir = OslQtCommon
    OslQtGui.subdir = OslQtGui
    Marco.subdir = Marco
    # external subdirs not in the SUBDIRS directive... for build purposes.
    # these will get checked out by the build script but are ignored by qmake and creator
    icShared.subdir = icShared
    HF_Shared.subdir = HF_Shared
    # dependencies
    IcIface.depends = OslCommon
    OslQtCommon.depends = OslCommon
    OslQtCommon.depends = IcIface
    OslQtGui.depends = IcIface
    OslQtGui.depends = OslQtCommon
    Marco.depends = IcIface
    Marco.depends = OslQtCommon
    Marco.depends = OslQtGui
    # This sections defines the package target and adds it to
    # INSTALLS so that it will run by 'make install'
    # location of the output package
    package.path = $${PACKAGE_DIR}/$${CONFIGDIR}
    linux {
    package.commands += "export LD_LIBRARY_PATH=$${GLOBAL_BUILD_PATH}/OslCommon/$${CONFIGDIR}:$${GLOBAL_BUILD_PATH}/OslQtCommon/$${CONFIGDIR}:$${GLOBAL_BUILD_PATH}/IcIface/$${CONFIGDIR};"
    package.commands += $${LIN_DEPLOY_COMMAND} $${DEPLOY_TARGET} -appimage -bundle-non-qt-libs -verbose=1;
    macx {
    package.commands += "export DYLD_LIBRARY_PATH=$${GLOBAL_BUILD_PATH}/OslCommon/$${CONFIGDIR}:$${GLOBAL_BUILD_PATH}/OslQtCommon/$${CONFIGDIR}:$${GLOBAL_BUILD_PATH}/IcIface/$${CONFIGDIR};"
    package.commands += $${MAC_DEPLOY_COMMAND} $${DEPLOY_TARGET} -verbose=1;
    # Some special things have to be done for OSX to copy the shared libs
    # into the application bundle. This is a bit tedious but there
    # doesn't seem to be a better way to handle non-qt dependencies.
    # macdeployqt doesn't pick them up.
    # copy shared libs (dylib files) into app bundle.
    # eg: cp /Users/mhiggins/QTBF/build/OslCommon/release/libOslCommon.1.0.0.dylib
    #package.commands += "mkdir $${DEPLOY_TARGET}/Contents/Frameworks;"
    package.commands += "cp $${GLOBAL_BUILD_PATH}/OslCommon/$${CONFIGDIR}/libOslCommon.1.0.0.dylib $${DEPLOY_TARGET}/Contents/Frameworks/;"
    package.commands += "cp $${GLOBAL_BUILD_PATH}/IcIface/$${CONFIGDIR}/libIcIface.1.0.0.dylib $${DEPLOY_TARGET}/Contents/Frameworks/;"
    package.commands += "cp $${GLOBAL_BUILD_PATH}/OslQtCommon/$${CONFIGDIR}/libOslQtCommon.1.0.0.dylib $${DEPLOY_TARGET}/Contents/Frameworks/;"
    package.commands += "cp $${GLOBAL_BUILD_PATH}/OslQtGui/$${CONFIGDIR}/libOslQtGui.1.0.0.dylib $${DEPLOY_TARGET}/Contents/Frameworks/;"
    # app bundle icon
    package.commands += "cp $${PWD}/$${TARGET}/$${ICNS_FILE}.icns $${DEPLOY_TARGET}/Contents/Resources/;"
    # update the shaed lib dependency paths for each of the executables and libs in the app bundle
    # eg: install_name_tool -change libOslCommon.1.dylib  @rpath/libOslCommon.1.0.0.dylib
    #     install_name_tool -change libOslCommon.1.dylib  @rpath/libOslCommon.1.0.0.dylib
    # IcIface
    package.commands += "install_name_tool -change libOslCommon.1.dylib @rpath/libOslCommon.1.0.0.dylib $${DEPLOY_TARGET}/Contents/Frameworks/libIcIface.1.0.0.dylib;"
    # OslQtCommon
    package.commands += "install_name_tool -change libOslCommon.1.dylib @rpath/libOslCommon.1.0.0.dylib $${DEPLOY_TARGET}/Contents/Frameworks/libOslQtCommon.1.0.0.dylib;"
    package.commands += "install_name_tool -change libIcIface.1.dylib @rpath/libIcIface.1.0.0.dylib $${DEPLOY_TARGET}/Contents/Frameworks/libOslQtCommon.1.0.0.dylib;"
    # OslQtGui
    package.commands += "install_name_tool -change libOslCommon.1.dylib @rpath/libOslCommon.1.0.0.dylib $${DEPLOY_TARGET}/Contents/Frameworks/libOslQtGui.1.0.0.dylib;"
    package.commands += "install_name_tool -change libOslQtCommon.1.dylib @rpath/libOslQtCommon.1.0.0.dylib $${DEPLOY_TARGET}/Contents/Frameworks/libOslQtGui.1.0.0.dylib;"
    package.commands += "install_name_tool -change libIcIface.1.dylib @rpath/libIcIface.1.0.0.dylib $${DEPLOY_TARGET}/Contents/Frameworks/libOslQtGui.1.0.0.dylib;"
    # Marco exectuable
    package.commands += "install_name_tool -change libOslCommon.1.dylib @rpath/libOslCommon.1.0.0.dylib $${DEPLOY_TARGET}/Contents/MacOS/Marco;"
    package.commands += "install_name_tool -change libIcIface.1.dylib @rpath/libIcIface.1.0.0.dylib $${DEPLOY_TARGET}/Contents/MacOS/Marco;"
    package.commands += "install_name_tool -change libOslQtCommon.1.dylib @rpath/libOslQtCommon.1.0.0.dylib $${DEPLOY_TARGET}/Contents/MacOS/Marco;"
    package.commands += "install_name_tool -change libOslQtGui.1.dylib @rpath/libOslQtGui.1.0.0.dylib $${DEPLOY_TARGET}/Contents/MacOS/Marco;"
    #package.commands += $${MAC_DEPLOY_COMMAND} $${DEPLOY_TARGET} -dmg -verbose=1;
    #package.files += $$shell_quote($$shell_path($${GLOBAL_BUILD_PATH}/$${TARGET}/$${CONFIGDIR}/$${TARGET}.dmg))
    osx_post_package.path = $${PACKAGE_DIR}
    # Set the app icon in the Info.plist file using the defaults command , convert it back to XML using plutil command
    osx_post_package.commands += "defaults write $${PACKAGE_DIR}/$${CONFIGDIR}/$${BUNDLE_NAME}/Contents/Info.plist CFBundleIconFile -string '$${ICNS_FILE}';"
    osx_post_package.commands += "plutil -convert xml1 $${PACKAGE_DIR}/$${CONFIGDIR}/$${BUNDLE_NAME}/Contents/Info.plist;"
    # dmg icon
    osx_post_package.commands += "cp $${PWD}/logo_halo256.icns $${PACKAGE_DIR}/$${CONFIGDIR}/.VolumeIcon.icns;"
    # create a DMG file for the app
    #create_dmg.bash Marco /Users/mhiggins/output/Marco_v2_0_2_b04/package/release
    osx_post_package.commands += "$${PWD}/create_dmg.bash $${TARGET} $${PACKAGE_DIR}/$${CONFIGDIR};"
    win32 {
    # add windeployqt to the target
    package.commands += $${WIN_DEPLOY_COMMAND} $${DEPLOY_TARGET} \
    	--dir $${PACKAGE_DIR}/$${CONFIGDIR} \
    	--network \
    # Internal libs
    package.files += $${GLOBAL_BUILD_PATH}/OslCommon/$${CONFIGDIR}/OslCommon.dll
    package.files += $${GLOBAL_BUILD_PATH}/OslQtCommon/$${CONFIGDIR}/OslQtCommon.dll
    package.files += $${GLOBAL_BUILD_PATH}/OslQtGui/$${CONFIGDIR}/OslQtGui.dll
    package.files += $${GLOBAL_BUILD_PATH}/IcIface/$${CONFIGDIR}/IcIface.dll
    # the main applicatin executable
    package.files += $${DEPLOY_TARGET}
    #package.files += $${PWD}/OS-icon-256-halo.ico
    INSTALLS += package
    # add the mac os post-package steps (for creating dmg file)
    osx_post_package.depends = $${INSTALLS}
    INSTALLS += osx_post_package
    # run windeployqt after linking

    And here is common.pri:

    #message("Path to .pri is "$$_PRO_FILE_)
    CONFIG(debug, debug|release) {
        CONFIGDIR = "debug"
    } else {
        CONFIGDIR = "release"
    # Set the build output directory if BUILD_DIRNAME not passed to qmake 
    !defined(BUILD_DIRNAME, var) {
    	#message("BUILD_DIRNAME Not Defined! Using default name: build")
    	BUILD_DIRNAME = "build"
    win32 {
    	QT_INSTALL_PATH = C:\Qt5.7\5.7\mingw53_32
    	# Edit these paths for working in Creator
    	GLOBAL_BUILD_PATH = D:/workspace-qt/$$BUILD_DIRNAME
    	IC_INCLUDES_PATH = D:\workspace-qt
    	QT_INCLUDES_PATH = D:\workspace-qt
    	!defined(EXTERNAL_LIBS, var) {
    		EXTERNAL_LIBS = D:/libs
    	# Set these paths for the build machine
    	WIN_SDK="C:\Program Files (x86)\Windows Kits\10"
    	WIN_DEPLOY_COMMAND = "C:\Qt5.7\5.7\mingw53_32\bin\windeployqt"
    linux {
    	IC_INCLUDES_PATH = /home/<user>/QTBF
    	QT_INCLUDES_PATH = /home/<user>/QTBF
    	!defined(EXTERNAL_LIBS, var) {
    		EXTERNAL_LIBS = /opt/devapps
    	#This must be on the path
    	LIN_DEPLOY_COMMAND = linuxdeployqt
    macx {
    		#QT_INSTALL_PATH = /apps/qt/5.5/
    		#EXTERNAL_LIBS = /devtools/libs
    		IC_INCLUDES_PATH = /Users/<user>/QTBF
    		QT_INCLUDES_PATH = /Users/<user>/QTBF
    		TARGET_CUSTOM_EXT = .app
    		TARGET_SHARED_EXT = .dylib
    	#This must be on the path
    	MAC_DEPLOY_COMMAND = macdeployqt
    # This is for command line builds. BUILD_ROOT is defined on the qmake command
    # in line and overrides the GLOBAL_BUILD_PATH setting above.
    defined(BUILD_ROOT, var) {
    	message( BUILD_ROOT is set: $$BUILD_ROOT)
    # don't edit these... they're derived from above
    #DEFINES += IC_BAUDS B230400 B4000000
    QMAKE_CXXFLAGS += -std=c++0x
    #QMAKE_CXXFLAGS += -std=gnu++11
    QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-variable \
    	-Wno-unused-parameter \
    UI_DIR = ui
    MOC_DIR = moc
    OBJECTS_DIR = obj
    # Uncomment the following line to help debug the deploy command when running qmake

    This is a really big project and the developer who built it just left recently, so I would appreciate any help I can get. Thank you.

  • I should also mention that oslqtcommon.qrc is in fact located in the OslQtCommon directory.

Log in to reply