Deployed Windows Executable Does Not Run

5264
5
Jump to solution
01-29-2016 02:48 PM
BenSaunders1
New Contributor III

I am running Qt Creator 3.6.0 based on Qt 5.5.1 and the ArcGIS Runtime Qt 10.26, compiling to MSVC 2013 32-bit . I build an ArcGIS Runtime 10.2.6 Qt Quick Application using the straight template (no additions) and deploy it, complete with running qtwindeploy.exe in the Qt 5.5 32-bit for Desktop (MSVC 2013) command window after running the vcvarsall.bat to complete the environment setup. Running the resulting deployed executable does nothing - no error messages, no alerts, no entries in the Windows Event Viewer, no application, no nothing - on any machine I copy everything to (including the machine it was developed on). The resulting directory that I deployed:

It builds and runs within Qt Creator without any problems - I see the map and I'm able to pan, zoom, etc.

If I simply create a Qt Quick application using that out-of-the-box template and deploy it following the same process, its executable runs as expected.

If I take that same Qt Quick application, add the ArcGIS Runtime to the project file:

TEMPLATE = app

QT += qml quick
CONFIG += c++11 arcgis_runtime_qml10_2_6

SOURCES += main.cpp

RESOURCES += qml.qrc

# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =

# Default rules for deployment.
include(deployment.pri)

and simply import the ArcGIS runtime into a .qml file:

import QtQuick 2.5
import ArcGIS.Runtime 10.26

Rectangle {
    property alias mouseArea: mouseArea

    width: 360
    height: 360

    MouseArea {
        id: mouseArea
        anchors.fill: parent
    }

    Text {
        anchors.centerIn: parent
        text: "Hello World"
    }
}

The resulting executable will not run again without any message or anything indicating what went wrong. And note, I didn't even add any ArcGIS controls (e.g. Map). While there is not error indicated in the Edit, in Design there is the following issue:

which is curious and my only indication of any sort of problem. This app builds and runs fine within Qt Creator too.

If anyone has any suggestions on things to look at, I sure would appreciate it! I have successfully deployed the same code to Android, so it really has narrowed down to Windows (and my inability to figure out what I'm missing...!).

Thanks!

Ben

Tags (1)
1 Solution

Accepted Solutions
BenSaunders1
New Contributor III

Well, I went through things and discovered the following:

  • The placement of the QML folders is actually fine with the template application. I do not need to rearrange them for whatever reason.
  • The application simply needed the EsriRuntimeQt.dll. That was the only change needed to make it run.

So the last item brings up a question: where did I miss seeing the need to copy that out of the ArcGIS Runtime install directory manually (outside of generic statements like "associated resources")?

I also stumbled across the DeploymentTool.exe in the Runtime installation and it appears to bundle the EsriRuntimeQt.dll for future deployment. However, I'm not finding any documentation on it as well. I know I'm missing the boat somewhere...!

But I do want to say thanks, Luke, for putting me on the right track. Any additional insight you can add on these things would be great!

Ben

View solution in original post

5 Replies
LucasDanzinger
Esri Frequent Contributor

Hey Ben,

A good place to start is to look at our sample application. You can even just try dropping the executable you built directly next to the sample app exe, and that should work (as long as it is 32-bit release, as the SDK comes with the 32-bit version on Windows). This probably contains way more than you need, so you can then go through and remove whatever dependencies you don't think you need, and test it along the way.

One thing that looks possible wrong with your screenshot is the QML folders are all at the same folder level as the exe, but I believe the template is setup to use a folder called "qml" next to the exe, and then under that will be all of your QML plugins. Beyond that, it is possible there are some other missing dependencies that the Qt tool didn't pick up.

-Luke

BenSaunders1
New Contributor III

Dropping the .exe in with the Sample App did get it to run, so clearly it is something with how I'm deploying!

I'll look into the QML folder level and report back...

Thanks, Luke!

Ben

0 Kudos
BenSaunders1
New Contributor III

Well, I went through things and discovered the following:

  • The placement of the QML folders is actually fine with the template application. I do not need to rearrange them for whatever reason.
  • The application simply needed the EsriRuntimeQt.dll. That was the only change needed to make it run.

So the last item brings up a question: where did I miss seeing the need to copy that out of the ArcGIS Runtime install directory manually (outside of generic statements like "associated resources")?

I also stumbled across the DeploymentTool.exe in the Runtime installation and it appears to bundle the EsriRuntimeQt.dll for future deployment. However, I'm not finding any documentation on it as well. I know I'm missing the boat somewhere...!

But I do want to say thanks, Luke, for putting me on the right track. Any additional insight you can add on these things would be great!

Ben

LucasDanzinger
Esri Frequent Contributor

Glad you got it working. The EsriRuntimeQt.dll is a dependency of the ArcGIS Runtime QML Plugin, so this is required for all apps using ArcGIS Runtime for Qt. I don't know that we have a specific place in the doc that states this, but we should. I will make a note to add some of this information for our Quartz release. A good tool I like to use on Windows is called Dependency Walker, and this will tell you all of the dependencies that your application requires.

The "Deployment Tool" is really only for Local Server. It does not do anything for QML (as local server requires C++), and will copy in lots of local server binaries into your app.

-Luke

BenSaunders1
New Contributor III

Got it. Thanks, Luke!

0 Kudos