Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [qt.qpa.plugin] Could not find the Qt platform plugin "cocoa" in "" error after add CODE_SIGN_ENTITLEMENTS to the project
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 520 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anatoliy
    wrote on last edited by Anatoliy
    #1

    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>
    
    S 1 Reply Last reply
    0
    • S Offline
      S Offline
      SDeveloperEu
      wrote on last edited by
      #2

      same problem with c++ qml qmake project
      mac os ventura
      qt 6.5.3
      xcode 15

      1 Reply Last reply
      0
      • A Anatoliy

        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>
        
        S Offline
        S Offline
        SDeveloperEu
        wrote on last edited by
        #3

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

        <key>com.apple.security.app-sandbox</key>
        <true/>

        looks like problem in this, if set to "false" then no errors

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved