Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

[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.name = CODE_SIGN_ENTITLEMENTS
    MY_ENTITLEMENTS.value = $$PRO_PATH/mac/myapp.entitlements
    QMAKE_MAC_XCODE_SETTINGS += MY_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">
    <dict>
    	<key>com.apple.developer.networking.networkextension</key>
    	<array>
    		<string>app-proxy-provider</string>
    		<string>content-filter-provider</string>
    		<string>dns-proxy</string>
    		<string>packet-tunnel-provider</string>
    	</array>
    	<key>com.apple.developer.networking.vpn.api</key>
    	<array>
    		<string>allow-vpn</string>
    	</array>
    	<key>com.apple.security.app-sandbox</key>
    	<true/>
    	<key>com.apple.security.files.user-selected.read-only</key>
    	<true/>
    	<key>com.apple.security.network.client</key>
    	<true/>
    	<key>com.apple.security.network.server</key>
    	<true/>
    </dict>
    </plist>
    

Log in to reply