Issue
I'm using Qt on Ubuntu 20.04.6 LTS. I received a notification about a Qt update, so I updated Qt. After that, whenever I try to open Qt Creator, I get this error:
from 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin.
Could not load the Qt platform plugin "xcb" 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: minimalegl, scb, eglfs, minimal, linuxfb, vkkhrdisplay, offscreen, vnc, wayland, wayland-egl.
I've tried uninstalling and reinstalling Qt, but it did not help. I've also looked into other questions and answers available on Stack Overflow and other platforms, but none of them fixed my problem.
I've tried:
- QT6: "qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found."
- PIXLS US — Could not load the Qt platform plugin “xcb” in “” even though it was found
Screenshot of the issue:
Solution
Ensure the xcb-cursor0 library is installed using:
sudo apt-get install libxcb-cursor0
Verify your Qt installation with:
sudo apt-get install --reinstall qt5-default
Check library paths:
export LD_LIBRARY_PATH=/path/to/libxcb-cursor0:$LD_LIBRARY_PATH
Restart Qt Creator. If the issue persists, try:
qtcreator -reconfigure
If you're getting Unable to locate package libxcb-cursor0
while installing libxcb-cursor0
try installing libxcb-cursor1
using sudo apt-get install libxcursor1
. After installing this package, retry the steps to resolve the Qt platform plugin xcb issue in Qt Creator. If the error persists, follow the steps below.
In Ubuntu 20.04, the libxcb-cursor-dev package may not be available in the default repositories. You can try installing it from the "universe" repository. Here's how you can do it:
- Enable the Universe Repository:
sudo add-apt-repository universe
sudo apt-get update
- Install libxcb-cursor-dev:
sudo apt-get install libxcb-cursor-dev
- Try installing libxcb-cursor0:
sudo apt-get install libxcb-cursor0
After these steps, try running your application again. If the problem persists or if you encounter any errors, let me know.
Ensure compatibility between the Qt version and your system. These steps should resolve the issue.
Answered By - BugsFounder Answer Checked By - Dawn Plyler (WPSolving Volunteer)