title: Unable to run Android Emulator - QT failed to extract, not a plugin
body: <p>As per the unhelpful response from Yunnosch on <a href="https://stackoverflow.com/questions/59800001/unable-to-run-android-emulator-for-connected-tests-in-jenkins">Unable to run Android Emulator for connected tests in jenkins</a></p>
  <p>I am running a linux box with Android studio and have setup an AVD. I can run it manually from android studio but running it like <code>emulator -avd emulator-5554</code> or from Azure Pipelines gives me QT errors. I've installed QT from commandline and direct from their website with all the tools and the paths exist.</p>
  <pre><code>Fatal: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
  </code></pre>
  <p>With debug enabled for qt plugin I was able to see the detailed errors:</p>
  <pre><code>emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() checking directory path &quot;./lib64/qt/plugins&quot; ... ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() checking directory path &quot;/usr/lib/Android/Sdk/emulator/lib64/qt/plugins&quot; ... ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() checking directory path &quot;/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64&quot; ... ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() looking at &quot;/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-aarch64&quot; ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Debug: &quot;Failed to extract plugin meta data from '/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-aarch64'&quot;
           not a plugin ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() looking at &quot;/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-aarch64-headless&quot; ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Debug: &quot;Failed to extract plugin meta data from '/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-aarch64-headless'&quot;
           not a plugin ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() looking at &quot;/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-armel&quot; ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Debug: &quot;Failed to extract plugin meta data from '/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-armel'&quot;
           not a plugin ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() looking at &quot;/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-armel-headless&quot; ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Debug: &quot;Failed to extract plugin meta data from '/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-armel-headless'&quot;
           not a plugin ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() looking at &quot;/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-i386&quot; ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Debug: &quot;Failed to extract plugin meta data from '/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-i386'&quot;
           not a plugin ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() looking at &quot;/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-i386-headless&quot; ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Debug: &quot;Failed to extract plugin meta data from '/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-i386-headless'&quot;
           not a plugin ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() looking at &quot;/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-x86_64&quot; ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Debug: &quot;Failed to extract plugin meta data from '/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-x86_64'&quot;
           not a plugin ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() looking at &quot;/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-x86_64-headless&quot; ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Debug: &quot;Failed to extract plugin meta data from '/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-x86_64-headless'&quot;
           not a plugin ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() checking directory path &quot;./lib64/qt/plugins/platforms&quot; ... ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() looking at &quot;lib64/qt/plugins/platforms/libqxcb.so&quot; ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Warning: Found metadata in lib /usr/lib/Android/Sdk/emulator/lib64/qt/plugins/platforms/libqxcb.so, metadata=
  {
      &quot;IID&quot;: &quot;org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3&quot;,
      &quot;MetaData&quot;: {
          &quot;Keys&quot;: [
              &quot;xcb&quot;
          ]
      },
      &quot;archreq&quot;: 0,
      &quot;className&quot;: &quot;QXcbIntegrationPlugin&quot;,
      &quot;debug&quot;: false,
      &quot;version&quot;: 330752
  }
  
   ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Debug: Got keys from plugin meta data (&quot;xcb&quot;) ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() checking directory path &quot;/usr/lib/Android/Sdk/emulator/lib64/qt/plugins/platforms&quot; ... ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() looking at &quot;/usr/lib/Android/Sdk/emulator/lib64/qt/plugins/platforms/libqxcb.so&quot; ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Debug: Got keys from plugin meta data (&quot;xcb&quot;) ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() checking directory path &quot;/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/platforms&quot; ... ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Debug: loaded library &quot;/usr/lib/Android/Sdk/emulator/lib64/qt/plugins/platforms/libqxcb.so&quot; ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Warning: could not connect to display  ((null):0, (null))
  
  
  emulator: INFO: QtLogger.cpp:68: Info: Could not load the Qt platform plugin &quot;xcb&quot; in &quot;./lib64/qt/plugins&quot; even though it was found. ((null):0, (null))
  
  
  Fatal: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
  
  Available platform plugins are: xcb.
   ((null):0, (null))
  </code></pre>
  <p>Note: I have also added environment variables for QT but nothing worked.</p>