Qt World Summit: Register Today!

[qt.qpa.plugin] Could not find the Qt platform plugin "cocoa" in "" error after add CODE_SIGN_ENTITLEMENTS to the project

  • Hi

    Have qt project for macOS. Try build with entitlements file.
    (Qt 5.14.2, macOs 10.15.4, Xcode 11.4)

    Without Entitlements file, the project is built and successfully launched from both QtCreator and xCode.

    Entitlements file attach this way:
    MY_ENTITLEMENTS.value = $$PRO_PATH/mac/myapp.entitlements

    launch qmake to generate xcode project

    Users/kondrik/Qt5.14.2/5.14.2/clang_64/bin/qmake ../myapp/myapp.pro -r -spec macx-xcode "CONFIG+=release"

    Then open the Xcode project, start app, program is builded and launched. When instantiate QApplication in the log get error:

    **[qt.qpa.plugin] Could not find the Qt platform plugin "cocoa" in ""**

    Entitlements file content:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">

Log in to reply