Issue with Qt WinRT app on Qt 5.15.2
-
Hello!
I want to build the default (empty)
WinRTproject usingQt 5.15.2 winrt_x86_msvc2019kit. It compiles sucessfully. When I run the program, it crashes with the following output:Windows.UI.Xaml.dll!62C436C4: (caller: 008050AF) FailFast(1) tid(1130) 8000FFFF Catastrophic failureSo, I run it using
winrtrunner, then I get this output:winrtrunner.exe "C:\Users\cobra\Documents\Projects\UWP\build-TestUWP23-Desktop_Qt_UWP_5_15_2_MSVC2019_32bit-Debug\debug\TestUWP23.exe" --install qt.winrtrunner: Using the Appx profile. qt.winrtrunner: Could not open qt.conf for writing.I think, that something is missing. Any ideas? Thank you.
-
I have found out that program build directory is missing:
assetsfolder andAppxManifest.xmlfile even though I run
QMAKE_POST_LINK = $$(QTDIR)/bin/windeployqt.exe $$shell_quote($$DESTDIR/$$shell_quote($$TARGET).exe) --no-compiler-runtimeI copied it manually from
C:\Qt\5.15.2\winrt_x86_msvc2019\binto program build directory. Then I runwinrtrunneragain:winrtrunner.exe "C:\Users\cobra\Documents\Projects\UWP\build-TestUWP23-Desktop_Qt_UWP_5_15_2_MSVC2019_32bit-Debug\debug\TestUWP23.exe" --install qt.winrtrunner: Using the Appx profile. qt.winrtrunner: Failed to activate application: 0x80070002 "The system cannot find the file specified."I think, I need to modify this
AppxManifest.xmlfile in order to make it working. But my question is whywindeployqtdoes not putassetsfolder andAppxManifest.xmlto the program build directory? Thank you. -
Yes, after I set the proper values for
AppxManifest.xmlfile and changed theQt Creatorrun configuration then it runs successfully.Command:
C:\Qt\5.15.2\winrt_x86_msvc2019\bin\winrtrunner.exe "C:\Users\cobra\Documents\Projects\UWP\build-TestUWP23-Desktop_Qt_UWP_5_15_2_MSVC2019_32bit-Debug\debug\TestUWP23.exe" --install --verboseBut I am still wondering why
windeployqttool does not add theassetsfolder andAppxManifest.xmlto the program build folder? Orwindeployqtdoes not take into account theassetsfolder andAppxManifest.xmlfile and you should copy it manually? Thank you. -
I've never used Qt with WinRT, but do you have your manifest file specified in the .pro file via WINRT_MANIFEST? The doc says you need a verbatim config to copy it to the output dir i.e.
WINRT_MANIFEST = someManifest.xml.in WINRT_MANIFEST.CONFIG += verbatim -
I've never used Qt with WinRT, but do you have your manifest file specified in the .pro file via WINRT_MANIFEST? The doc says you need a verbatim config to copy it to the output dir i.e.
WINRT_MANIFEST = someManifest.xml.in WINRT_MANIFEST.CONFIG += verbatimHello!
I have added it:
WINRT_MANIFEST = someManifest.xml.in WINRT_MANIFEST.CONFIG += verbatimto the
.profile. Runclean,qmake,buildand still the same, no manifest or assets in the program build directory. Any ideas?
Thank you. -
Hello!
I have added it:
WINRT_MANIFEST = someManifest.xml.in WINRT_MANIFEST.CONFIG += verbatimto the
.profile. Runclean,qmake,buildand still the same, no manifest or assets in the program build directory. Any ideas?
Thank you.@Cobra91151 I hope you actually changed the file name in
WINRT_MANIFEST = someManifest.xml.into your manifest file path and not just copy/pasted this? :) -
@Cobra91151 I hope you actually changed the file name in
WINRT_MANIFEST = someManifest.xml.into your manifest file path and not just copy/pasted this? :)Of course I have changed it :)
I have tiedTestUWP23.xml.in,TestUWP23.xml, butwindeployqtstill does not copy the required assets/manifest..pro file:
QT += core gui TARGET = TestUWP23 greaterThan(QT_MAJOR_VERSION, 4): QT += widgets CONFIG += c++17 WINRT_MANIFEST = AppxManifest.xml.in WINRT_MANIFEST.CONFIG += verbatim CONFIG(debug, debug|release) { DESTDIR = $$OUT_PWD/debug } else { DESTDIR = $$OUT_PWD/release } # You can make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += \ main.cpp \ dialog.cpp HEADERS += \ dialog.h LIBS += -lwindowsapp QMAKE_POST_LINK = $$(QTDIR)/bin/windeployqt.exe $$shell_quote($$DESTDIR/$$shell_quote($$TARGET).exe) --no-compiler-runtime -
Sorry, like I said I haven't used UWP Qt and I don't have a kit handy to try it. Maybe windeployqt is just not very UWP aware.
-
Sorry, like I said I haven't used UWP Qt and I don't have a kit handy to try it. Maybe windeployqt is just not very UWP aware.
I have found 2 manifest files in
Qtdirectory:C:\Qt\5.15.2\winrt_x86_msvc2019\bin\AppxManifest.xml
<?xml version="1.0" encoding="utf-8"?> <Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3" xmlns:mobile="http://schemas.microsoft.com/appx/manifest/mobile/windows10" xmlns:iot="http://schemas.microsoft.com/appx/manifest/iot/windows10" IgnorableNamespaces="uap uap3 mp mobile iot"> <Identity Name="066dc9bf-27bd-4f3e-abbc-06652d5ce6ce" Publisher="CN=qt" Version="1.0.0.0" ProcessorArchitecture="x86" /> <mp:PhoneIdentity PhoneProductId="066dc9bf-27bd-4f3e-abbc-06652d5ce6ce" PhonePublisherId="00000000-0000-0000-0000-000000000000"/> <Properties> <DisplayName>xmlpatterns</DisplayName> <PublisherDisplayName>Default publisher display name</PublisherDisplayName> <Logo>assets/logo_store.png</Logo> </Properties> <Dependencies> <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.14393.0" MaxVersionTested="10.0.14393.0" /> <PackageDependency Name="Microsoft.VCLibs.140.00.Debug" MinVersion="14.0.0.0" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" /> </Dependencies> <Resources> <Resource Language="en"/> </Resources> <Applications> <Application Id="App" Executable="xmlpatterns.exe" EntryPoint="xmlpatterns.App"> <uap:VisualElements DisplayName="xmlpatterns" Description="Default package description" BackgroundColor="green" Square150x150Logo="assets/logo_150x150.png" Square44x44Logo="assets/logo_44x44.png"> <uap:SplashScreen Image="assets/logo_620x300.png" /> </uap:VisualElements> </Application> </Applications> <Capabilities> <Capability Name="internetClient" /> <Capability Name="internetClientServer" /> <Capability Name="privateNetworkClientServer" /> </Capabilities> </Package>And the second one:
C:\Qt\5.15.2\winrt_x86_msvc2019\mkspecs\common\winrt_winphone\manifests\10.0\AppxManifest.xml.in
<?xml version=\"1.0\" encoding=\"utf-8\"?> <Package xmlns=\"http://schemas.microsoft.com/appx/manifest/foundation/windows10\" xmlns:mp=\"http://schemas.microsoft.com/appx/2014/phone/manifest\" xmlns:uap=\"http://schemas.microsoft.com/appx/manifest/uap/windows10\" xmlns:uap3=\"http://schemas.microsoft.com/appx/manifest/uap/windows10/3\" xmlns:mobile=\"http://schemas.microsoft.com/appx/manifest/mobile/windows10\" xmlns:iot=\"http://schemas.microsoft.com/appx/manifest/iot/windows10\" IgnorableNamespaces=\"uap uap3 mp mobile iot\"> <Identity Name=\"$${WINRT_MANIFEST.identity}\" Publisher=\"$${WINRT_MANIFEST.publisherid}\" Version=\"$${WINRT_MANIFEST.version}\" ProcessorArchitecture=\"$${WINRT_MANIFEST.architecture}\" /> <mp:PhoneIdentity PhoneProductId=\"$${WINRT_MANIFEST.identity}\" PhonePublisherId=\"$${WINRT_MANIFEST.phone_publisher_id}\"/> <Properties> <DisplayName>$${WINRT_MANIFEST.name}</DisplayName> <PublisherDisplayName>$${WINRT_MANIFEST.publisher}</PublisherDisplayName> <Logo>$${WINRT_MANIFEST.logo_store}</Logo> </Properties> <Dependencies> <TargetDeviceFamily Name=\"Windows.Universal\" MinVersion=\"$${WINRT_MANIFEST.minVersion}\" MaxVersionTested=\"$${WINRT_MANIFEST.maxVersionTested}\" />$${WINRT_MANIFEST.dependencies} </Dependencies> <Resources> <Resource Language=\"en\"/> </Resources> <Applications> <Application Id=\"App\" Executable=\"$${WINRT_MANIFEST.target}.exe\" EntryPoint=\"$${WINRT_MANIFEST.target}.App\"> <uap:VisualElements DisplayName=\"$${WINRT_MANIFEST.name}\" Description=\"$${WINRT_MANIFEST.description}\" BackgroundColor=\"$${WINRT_MANIFEST.background}\" Square150x150Logo=\"$${WINRT_MANIFEST.logo_150x150}\" Square44x44Logo=\"$${WINRT_MANIFEST.logo_44x44}\"> <uap:SplashScreen Image=\"$${WINRT_MANIFEST.logo_620x300}\" /> </uap:VisualElements> </Application> </Applications> $${WINRT_MANIFEST.capabilities} </Package>The last one has the preset constant values.
Anyway, I will keep working on this issue. Thank you for your help. -
Hello!
I have created my own tool called
winrtdeployto copyassetsdirectory and themanifestfile fromQtdirectory.winrtdeploy.exe --source=$$(QTDIR)/bin/assets --destination=$$shell_quote($$DESTDIR) --verboseNow, this issue is resolved.
Thank you.