https://bugs.dolphin-emu.org/https://bugs.dolphin-emu.org/favicon.ico?12019-03-20T19:12:16ZDolphin bug trackerEmulator - Emulator Issues #11332: Build MacOSX Could not load the Qt platform plugin "cocoa" in "" even though it was found.https://bugs.dolphin-emu.org/issues/11332?journal_id=7364132019-03-20T19:12:16Zkvark
<ul></ul><p>I faced the same issue on a fresh system, although with more output:</p>
<pre><code>objc[21251]: Class QMacAutoReleasePoolTracker is implemented in both /Users/mozilla/Code/dolphin/build/Binaries/Dolphin.app/Contents/Frameworks/QtCore.framework/Versions/5/QtCore (0x10f600080) and /usr/local/Cellar/qt/5.12.2/lib/QtCore.framework/Versions/5/QtCore (0x113672080). One of the two will be used. Which one is undefined.
objc[21251]: Class QT_ROOT_LEVEL_POOL__THESE_OBJECTS_WILL_BE_RELEASED_WHEN_QAPP_GOES_OUT_OF_SCOPE is implemented in both /Users/mozilla/Code/dolphin/build/Binaries/Dolphin.app/Contents/Frameworks/QtCore.framework/Versions/5/QtCore (0x10f6000f8) and /usr/local/Cellar/qt/5.12.2/lib/QtCore.framework/Versions/5/QtCore (0x1136720f8). One of the two will be used. Which one is undefined.
objc[21251]: Class RunLoopModeTracker is implemented in both /Users/mozilla/Code/dolphin/build/Binaries/Dolphin.app/Contents/Frameworks/QtCore.framework/Versions/5/QtCore (0x10f600120) and /usr/local/Cellar/qt/5.12.2/lib/QtCore.framework/Versions/5/QtCore (0x113672120). One of the two will be used. Which one is undefined.
QObject::moveToThread: Current thread (0x7fc582f00080) is not the object's thread (0x7fc582f07df0).
Cannot move to target thread (0x7fc582f00080)
You might be loading two sets of Qt binaries into the same process. Check that all plugins are compiled against the right Qt binaries. Export DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded.
qt.qpa.plugin: Could not load the Qt platform plugin "cocoa" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: cocoa.
</code></pre>
<p>Applying the proposed fix to CMakeLists txt and re-building doesn't work for me:</p>
<pre><code>Binaries/Dolphin.app/Contents/MacOS/platforms/libqcocoa.dylib:
/usr/local/opt/qt/plugins/platforms/libqcocoa.dylib (compatibility version 0.0.0, current version 0.0.0)
/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 934.0.0)
/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 158.0.0)
/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.11.0)
/System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo (compatibility version 1.2.0, current version 1.5.0)
/System/Library/Frameworks/Metal.framework/Versions/A/Metal (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libcups.2.dylib (compatibility version 2.0.0, current version 2.13.0)
/usr/local/Cellar/qt/5.12.2/lib/QtDBus.framework/Versions/5/QtDBus (compatibility version 5.12.0, current version 5.12.2)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1560.12.0)
/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 1247.4.1)
/System/Library/Frameworks/CoreText.framework/Versions/A/CoreText (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1560.12.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
/System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1671.10.106)
/usr/local/Cellar/qt/5.12.2/lib/QtPrintSupport.framework/Versions/5/QtPrintSupport (compatibility version 5.12.0, current version 5.12.2)
/usr/local/Cellar/qt/5.12.2/lib/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.12.0, current version 5.12.2)
/usr/local/Cellar/qt/5.12.2/lib/QtGui.framework/Versions/5/QtGui (compatibility version 5.12.0, current version 5.12.2)
/usr/local/Cellar/qt/5.12.2/lib/QtCore.framework/Versions/5/QtCore (compatibility version 5.12.0, current version 5.12.2)
/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.4)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 50.1.0)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
</code></pre>
<p>Changes from master:</p>
<pre><code class="diff syntaxhl" data-language="diff"><span class="gh">diff --git a/Source/Core/DolphinQt/CMakeLists.txt b/Source/Core/DolphinQt/CMakeLists.txt
index 85bc526ae6..ae6b28336f 100644
</span><span class="gd">--- a/Source/Core/DolphinQt/CMakeLists.txt
</span><span class="gi">+++ b/Source/Core/DolphinQt/CMakeLists.txt
</span><span class="p">@@ -239,3 +239,9 @@</span> endif()
if(USE_DISCORD_PRESENCE)
target_compile_definitions(dolphin-emu PRIVATE -DUSE_DISCORD_PRESENCE)
endif()
<span class="gi">+
+# Fix rpath
+add_custom_command(TARGET dolphin-emu
+ POST_BUILD COMMAND
+ ${CMAKE_INSTALL_NAME_TOOL} -add_rpath "@executable_path/../Frameworks/"
+ $<TARGET_FILE:dolphin-emu>)
</span></code></pre>
<p>Might have something to do that I provided <code>Qt5_DIR=/usr/local/Cellar/qt/5.12.2</code> upon running CMake? It doesn't find Qt otherwise.<br>
Please let me know if this is a different issue that should be filed separately.</p>
Emulator - Emulator Issues #11332: Build MacOSX Could not load the Qt platform plugin "cocoa" in "" even though it was found.https://bugs.dolphin-emu.org/issues/11332?journal_id=7364282019-03-21T20:12:45Zkvark
<ul></ul><p>Found a hack that solves this for me:</p>
<pre><code class="diff syntaxhl" data-language="diff"><span class="gh">diff --git a/Source/Core/DolphinQt/CMakeLists.txt b/Source/Core/DolphinQt/CMakeLists.txt
index 86a73c34ed..9fc1599fdd 100644
</span><span class="gd">--- a/Source/Core/DolphinQt/CMakeLists.txt
</span><span class="gi">+++ b/Source/Core/DolphinQt/CMakeLists.txt
</span><span class="p">@@ -220,8 +220,8 @@</span> if(APPLE)
endforeach()
<span class="err">
</span> # Update library references to make the bundle portable
<span class="gd">- include(DolphinPostprocessBundle)
- dolphin_postprocess_bundle(dolphin-emu)
</span><span class="gi">+ #include(DolphinPostprocessBundle) #TODO
+ #dolphin_postprocess_bundle(dolphin-emu)
</span> else()
install(TARGETS dolphin-emu RUNTIME DESTINATION ${bindir})
endif()
</code></pre> Emulator - Emulator Issues #11332: Build MacOSX Could not load the Qt platform plugin "cocoa" in "" even though it was found.https://bugs.dolphin-emu.org/issues/11332?journal_id=7364322019-03-22T20:27:28Zspycrab0
<ul><li><strong>Operating system</strong> <i>OS X</i> added</li><li><strong>Operating system</strong> deleted (<del><i>N/A</i></del>)</li></ul><p>I can't reproduce this with a very similar setup (only the Qt version is newer IIRC). <br>
Could you try to bisect the issue?</p>
Emulator - Emulator Issues #11332: Build MacOSX Could not load the Qt platform plugin "cocoa" in "" even though it was found.https://bugs.dolphin-emu.org/issues/11332?journal_id=7370312019-04-28T17:32:32Zfirodj
<ul></ul><p>I've got same exact error message on macOS Mojave (10.14.3), and the solution is still the same.</p>
<p>When I read again my blog: <a href="https://firodj.wordpress.com/2018/08/09/qt5-mac-osx-build-dolphin/" class="external">https://firodj.wordpress.com/2018/08/09/qt5-mac-osx-build-dolphin/</a> maybe to place where the custom command to put has an effect and it is after <code>dolphin_postprocess_bundle(dolphin-emu)</code>.</p>
<p>My setup for env on ~/.bash_profile:</p>
<pre><code>export Qt5_DIR=/usr/local/opt/qt5
export PATH=$PATH:$Qt5_DIR/bin
</code></pre>
<p>Then just rebuild with <code>cmake --build .</code><br>
Could you make sure if the LC_RPATH take effect? with <code>otool -l</code> (small letter l), see my blog.<br>
I am using cmake version 3.14.3 and qt 5.12.2 from Homebrew.</p>
<p>kvark wrote:</p>
<blockquote>
<p>I faced the same issue on a fresh system, although with more output:</p>
<pre><code>objc[21251]: Class QMacAutoReleasePoolTracker is implemented in both /Users/mozilla/Code/dolphin/build/Binaries/Dolphin.app/Contents/Frameworks/QtCore.framework/Versions/5/QtCore (0x10f600080) and /usr/local/Cellar/qt/5.12.2/lib/QtCore.framework/Versions/5/QtCore (0x113672080). One of the two will be used. Which one is undefined.
objc[21251]: Class QT_ROOT_LEVEL_POOL__THESE_OBJECTS_WILL_BE_RELEASED_WHEN_QAPP_GOES_OUT_OF_SCOPE is implemented in both /Users/mozilla/Code/dolphin/build/Binaries/Dolphin.app/Contents/Frameworks/QtCore.framework/Versions/5/QtCore (0x10f6000f8) and /usr/local/Cellar/qt/5.12.2/lib/QtCore.framework/Versions/5/QtCore (0x1136720f8). One of the two will be used. Which one is undefined.
objc[21251]: Class RunLoopModeTracker is implemented in both /Users/mozilla/Code/dolphin/build/Binaries/Dolphin.app/Contents/Frameworks/QtCore.framework/Versions/5/QtCore (0x10f600120) and /usr/local/Cellar/qt/5.12.2/lib/QtCore.framework/Versions/5/QtCore (0x113672120). One of the two will be used. Which one is undefined.
QObject::moveToThread: Current thread (0x7fc582f00080) is not the object's thread (0x7fc582f07df0).
Cannot move to target thread (0x7fc582f00080)
You might be loading two sets of Qt binaries into the same process. Check that all plugins are compiled against the right Qt binaries. Export DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded.
qt.qpa.plugin: Could not load the Qt platform plugin "cocoa" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
</code></pre></blockquote>
Emulator - Emulator Issues #11332: Build MacOSX Could not load the Qt platform plugin "cocoa" in "" even though it was found.https://bugs.dolphin-emu.org/issues/11332?journal_id=7470962024-03-19T02:30:22ZBilliard26jordan.woyak@gmail.com
<ul></ul><p>Is this issue still relevant?</p>