AppImageCommunity / pkg2appimage

Tool and recipes to convert existing deb packages to AppImage
http://appimage.org
MIT License
691 stars 213 forks source link

error Qt platform plugin "xcb" when building electrumfair pyqt wallet #333

Open capiscuas opened 6 years ago

capiscuas commented 6 years ago

I was able to build the AppImage fine for the electrumfair 2.x version, but with the new 3.x that uses pyqt5

i get this error once I execute the outputted .AppImage

 ○ ./out/Electrum_FairCoin_Wallet-.glibc2.17-x86_64.AppImage
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, xcb, vnc.

Reinstalling the application may fix this problem.

I will understand and apologize if you don't proved this kind of support with specific apps... I have tried many things already regarding copying the qt xcb libraries in the lib or usr/lib folder but same errors keeps showing....

app: electrumfair

ingredients:
  dist: xenial
  packages: 
    - python3-setuptools 
    - python3-pyqt5 
    - python3-pip
    - python3-dns       
  sources: 
    - deb http://es.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse 
  script:
    - wget -c "https://download.faircoin.world/electrum/ElectrumFair-3.0.5.tar.gz" 
    - tar zxvf ElectrumFair-3.0.5.tar.gz
script:
  - tar xf ../ElectrumFair-3.0.5.tar.gz -C usr/bin/ --strip 1
  - mv usr/bin/electrumfair.desktop .
  - mv usr/bin/icons/electrumfair.png .
  - mv electrumfair.png electrum.png   
probonopd commented 6 years ago

Thanks for opening this issue. First of all, please change

dist: xenial

to

dist: trusty

Reference: https://github.com/AppImage/AppImageKit/wiki/Creating-AppImages#creating-appimages-that-are-compatible-with-many-systems

capiscuas commented 6 years ago

Hi, thanks! I changed it to trusty, although the error is still happening.

probonopd commented 6 years ago

Please run LD_DEBUIG=libs ./Your.AppImage and see if you can detect errors in the output.

capiscuas commented 6 years ago

After running LD_DEBUG=libs ./out/Electrum_FairCoin_Wallet-.glibc2.17-x86_64.AppImage

      7597: find library=libgpg-error.so.0 [0]; searching
      7597:  search path=/tmp/.mount_Electr06mch4/usr/lib:/tmp/.mount_Electr06mch4/usr/lib/x86_64-linux-gnu:/tmp/.mount_Electr06mch4/lib:/tmp/.mount_Electr06mch4/lib/x86_64-linux-gnu:tls/x86_64:tls:x86_64:       (LD_LIBRARY_PATH)
      7597:   trying file=/tmp/.mount_Electr06mch4/usr/lib/libgpg-error.so.0
      7597:   trying file=/tmp/.mount_Electr06mch4/usr/lib/x86_64-linux-gnu/libgpg-error.so.0
      7597:   trying file=/tmp/.mount_Electr06mch4/lib/libgpg-error.so.0
      7597:   trying file=/tmp/.mount_Electr06mch4/lib/x86_64-linux-gnu/libgpg-error.so.0
      7597:   trying file=tls/x86_64/libgpg-error.so.0
      7597:   trying file=tls/libgpg-error.so.0
      7597:   trying file=x86_64/libgpg-error.so.0
      7597:   trying file=libgpg-error.so.0
      7597:  search cache=/etc/ld.so.cache
      7597:   trying file=/lib/x86_64-linux-gnu/libgpg-error.so.0
      7597: 
      7597: /tmp/.mount_Electr06mch4/usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5: error: symbol lookup error: undefined symbol: _ZNK14QPlatformTheme14fileIconPixmapERK9QFileInfoRK6QSizeF6QFlagsINS_10IconOptionEE (fatal)
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, xcb, vnc.

Reinstalling the application may fix this problem.

thanks a lot, I am getting closer!

agg3l commented 6 years ago

In my case (on ArchLinux) similar problem was caused by incompatible, recent, system libfontconfig.so.1

$ QT_DEBUG_PLUGINS=1 ./xyz.AppImage 
QFactoryLoader::QFactoryLoader() checking directory path "/tmp/.mount_4HJR9d/usr/lib64/qt5/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/tmp/.mount_4HJR9d/usr/lib64/qt5/plugins/platforms/libqxcb.so"
Found metadata in lib /tmp/.mount_4HJR9d/usr/lib64/qt5/plugins/platforms/libqxcb.so, metadata=
{
...
}

Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/tmp/.mount_4HJR9d/usr/bin/platforms" ...
loaded library "/tmp/.mount_4HJR9d/usr/lib64/qt5/plugins/platforms/libqxcb.so"
QLibraryPrivate::loadPlugin failed on "/tmp/.mount_4HJR9d/usr/lib64/qt5/plugins/platforms/libqxcb.so" : "Cannot load library /tmp/.mount_4HJR9d/usr/lib64/qt5/plugins/platforms/libqxcb.so: (/usr/lib/libfontconfig.so.1: undefined symbol: FT_Done_MM_Var)"
This application failed to start because it could not find or load the Qt platform plugin "xcb"

Resolved by using one from base system (CentOS6) into AppImage (i.e. removing libfontconfig.so from exclude list)

probonopd commented 6 years ago

Interesting, we had some discussion about libfontconfig here. Possibly related?

capiscuas commented 6 years ago

Thanks a lot! I managed to solve it too by using some qt from my ubuntu.

app: electrumfair

ingredients:
  dist: trusty
  packages: 
    - python3-setuptools 
    - python3-pyqt5 
    - python3-pip
    - libx11-xcb1
#    - libqt5gui5
#    - libgpg-error0

  sources: 
    - deb http://es.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse 
  script:
    - wget -c "https://download.faircoin.world/electrum/ElectrumFair-3.0.5.tar.gz" 
    - wget https://raw.githubusercontent.com/faircoin/electrumfair/3.0.5-fc/contrib/requirements.txt
    - tar zxvf ElectrumFair-3.0.5.tar.gz
    - pip3 install -r requirements.txt

script:
  - cp ../ElectrumFair-3.0.5/electrumfair.desktop .
  - cp ../ElectrumFair-3.0.5/icons/electrumfair.png electrum.png
  - cp ../ElectrumFair-3.0.5/electrumfair usr/bin/electrumfair
  - cp -rf ../ElectrumFair-3.0.5/lib usr/lib/python3/dist-packages/electrumfair
  - cp -rf ../ElectrumFair-3.0.5/gui usr/lib/python3/dist-packages/electrumfair_gui
  - cp -rf ../ElectrumFair-3.0.5/plugins usr/lib/python3/dist-packages/electrumfair_plugins
  - cp -rf ~/.local/lib/python3.5/site-packages/PyQt5/Qt/lib/* usr/lib/x86_64-linux-gnu
  - rm usr/lib/x86_64-linux-gnu/libQt5WebEngineCore.so.5
  - rm usr/lib/x86_64-linux-gnu/libicudata.so.56

Maybe it would be better if I can replace the ~/.local/lib/python3.5/site-packages/PyQt5/Qt/lib/* for something that can work for everybody, but for the moment works fine.