Error with Qt 6, Esri SDK 200.1 and Windows Deployment – cannot load ArcGISRuntimePlugin

696
3
09-01-2023 10:33 AM
Labels (2)
KCLewelling
New Contributor II

I am upgrading a Qt application from Qt 5.15 and Esri Maps SDK 100.15 to Qt 6.4 and Esri SDK 200.1, but now I am having trouble deploying it in Windows.  When I double-click the exe in the 'deployment' folder to run it, there is a quick flicker and then nothing.  The app closes immediately.  I have also tried building and deploying a simple Esri Qt Quick QML application, built from one of the templates that comes with the SDK, and I get the same error.

I added plugin debugging ( qputenv("QT_DEBUG_PLUGINS", "1")) and some logging to this test application to troubleshoot, and it shows an error when trying to load the ArcGISRuntimePlugin.dll (it is looking for it in the sdk install directory, not in the application directory):

qt.core.library: "C:/Program Files/ArcGIS SDKs/Qt200.1.0/sdk/windows/x64/qml/Esri/ArcGISRuntime/ArcGISRuntimePlugin.dll" cannot load: Cannot load library C:\Program Files\ArcGIS SDKs\Qt200.1.0\sdk\windows\x64\qml\Esri\ArcGISRuntime\ArcGISRuntimePlugin.dll: The specified module could not be found.

qt.core.plugin.loader: QLibraryPrivate::loadPlugin failed on "C:/Program Files/ArcGIS SDKs/Qt200.1.0/sdk/windows/x64/qml/Esri/ArcGISRuntime/ArcGISRuntimePlugin.dll" : "Cannot load library C:\\Program Files\\ArcGIS SDKs\\Qt200.1.0\\sdk\\windows\\x64\\qml\\Esri\\ArcGISRuntime\\ArcGISRuntimePlugin.dll: The specified module could not be found."

qt.core.plugin.loader: Found metadata in lib C:/TEMP/troubleshooting/testMap_200_1_build_Qt652/qml/Esri/ArcGISRuntime/ArcGISRuntimePlugin.dll

Here are the steps that I am following (I also tried running this process in Qt 6.2.9, which is what these steps are from):

  1. Run qmake and build application in Qt Creator (the app does run from within Qt Creator without a problem).
  2. Create a new folder, C:\TEMP\troubleshooting\testMap_200_1_deploy_Qt62, and copy the exe to this folder.  I also manually copy the following files/folders to this folder:
    • qml folder from the Esri SDK installation; this has the ArcGISRuntime and ArcGISExtras plugins. 
    • EsriCommonQt.dll
    • Msvcp140.dll
    • Vcruntime140.dll
    • Libcrypto-3-x64.dll
    • Libssl-3-x64.dll
  3. Run windeployqt :

C:\Qt\Qt6.2.9\6.2.9\msvc2019_64\bin\windeployqt.exe --core --opengl --sensors --positioning --widgets --quick --network --multimedia --qmldir C:\TEMP\troubleshooting\testMap_200_1\qml --release C:\TEMP\troubleshooting\testMap_200_1_deploy_Qt62 > C:\TEMP\troubleshooting\testMap_200_1_deploy_Qt62\packlog.txt

When I run a similar process with Qt 5.15 and Esri SDK 100.15, it works fine. 

I have tried several things to troubleshoot, including:

  • Copying the ArcGISRuntimePlugin.dll to different locations within my deployment folder
  • Adding an import path to a ‘relative’ copy of the runtime plugin (i.e referencing it via the applicationDirPath)
  • Running this in Qt 6.2.9 instead of 6.4.3.
  • And more. 

Any suggestions on what I am missing in this process?

Thanks.

0 Kudos
3 Replies
JamesBallard1
Esri Regular Contributor

Hi @KCLewelling. Thanks for reaching out to us.

Looking over your QT_DEBUG_PLUGINS output, I think that's pointing to the culprit. It looks like your app is attempting to load our QML API plugin (ArcGISRuntimePlugin.dll) from two different locations:

  1. The SDK installation location: "C:/Program Files/ArcGIS SDKs/Qt200.1.0/sdk/windows/x64/qml/Esri/ArcGISRuntime/ArcGISRuntimePlugin.dll"
  2. And a different one (maybe the 100.15 version) located at "C:/TEMP/troubleshooting/testMap_200_1_build_Qt652/qml/Esri/ArcGISRuntime/ArcGISRuntimePlugin.dll"

If you reconcile these, I think it may work for you. Our other dlls to watch out for are:

  • EsriCommonQt.dll 
  • ArcGISRuntimePlugin.dll
  • runtimecore.dll 

One other thing I spotted, which may be fine is that these dlls are likely OpenSSL 3, which is only supported out-of-the-box with Qt starting with Qt 6.5.

  • Libcrypto-3-x64.dll
  • Libssl-3-x64.dll

If you're using an older Qt version, you'll need the older SSL dlls. Usual caveats apply with encryption, so this is just a build configuration thing I noticed.

https://www.qt.io/blog/moving-to-openssl-3-in-binary-builds-starting-from-qt-6.5-beta-2 

Let us know if that works for you.

0 Kudos
KCLewelling
New Contributor II

James,

Thank you for your reply and help, particularly your mention of other dlls to watch for and the OpenSSL version.  I was missing runtimecore.dll.  I added that and replaced the OpenSSL dlls with the 1.1.1 versions, but I also needed to explicitly add websockets to my windeployqt.exe call.  Then my deployed application ran.  (In case it helps others, I found that Qt6WebSockets.dll was needed by using the Dependency Walker tool to check the different dependencies on the ArcGISRuntimePlugin.dll and EsriCommonQt.dll modules.)

To summarize, here are the changes I made to get this working:

  • Added runtimecore.dll to my deployment folder.
  • Replaced the OpenSSL dlls with version 1.1.1.
  • Added ‘websockets’ to my windeployqt call.

Thanks again for your prompt reply and help!

Kelley

JamesBallard1
Esri Regular Contributor

That's great to hear, @KCLewelling. I forgot about the new websocket dependency we'd added in the 200.x timeframe. Glad you got that one figured out.

0 Kudos