Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Issue with Qt WinRT app on Qt 5.15.2
Forum Updated to NodeBB v4.3 + New Features

Issue with Qt WinRT app on Qt 5.15.2

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 2 Posters 566 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Cobra91151C Offline
    Cobra91151C Offline
    Cobra91151
    wrote on last edited by
    #1

    Hello!

    I want to build the default (empty) WinRT project using Qt 5.15.2 winrt_x86_msvc2019 kit. 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 failure
    

    So, 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.

    1 Reply Last reply
    0
    • Cobra91151C Offline
      Cobra91151C Offline
      Cobra91151
      wrote on last edited by Cobra91151
      #2

      I have found out that program build directory is missing: assets folder and AppxManifest.xml file even though I run
      QMAKE_POST_LINK = $$(QTDIR)/bin/windeployqt.exe $$shell_quote($$DESTDIR/$$shell_quote($$TARGET).exe) --no-compiler-runtime

      I copied it manually from C:\Qt\5.15.2\winrt_x86_msvc2019\bin to program build directory. Then I run winrtrunner again:

      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.xml file in order to make it working. But my question is why windeployqt does not put assets folder and AppxManifest.xml to the program build directory? Thank you.

      1 Reply Last reply
      0
      • Cobra91151C Offline
        Cobra91151C Offline
        Cobra91151
        wrote on last edited by Cobra91151
        #3

        Yes, after I set the proper values for AppxManifest.xml file and changed the Qt Creator run 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 --verbose
        

        But I am still wondering why windeployqt tool does not add the assets folder and AppxManifest.xml to the program build folder? Or windeployqt does not take into account the assets folder and AppxManifest.xml file and you should copy it manually? Thank you.

        1 Reply Last reply
        0
        • Chris KawaC Offline
          Chris KawaC Offline
          Chris Kawa
          Lifetime Qt Champion
          wrote on last edited by Chris Kawa
          #4

          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
          
          Cobra91151C 1 Reply Last reply
          0
          • Chris KawaC Chris Kawa

            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
            
            Cobra91151C Offline
            Cobra91151C Offline
            Cobra91151
            wrote on last edited by
            #5

            @Chris-Kawa

            Hello!

            I have added it:

            WINRT_MANIFEST = someManifest.xml.in
            WINRT_MANIFEST.CONFIG += verbatim
            

            to the .pro file. Run clean, qmake, build and still the same, no manifest or assets in the program build directory. Any ideas?
            Thank you.

            Chris KawaC 1 Reply Last reply
            0
            • Cobra91151C Cobra91151

              @Chris-Kawa

              Hello!

              I have added it:

              WINRT_MANIFEST = someManifest.xml.in
              WINRT_MANIFEST.CONFIG += verbatim
              

              to the .pro file. Run clean, qmake, build and still the same, no manifest or assets in the program build directory. Any ideas?
              Thank you.

              Chris KawaC Offline
              Chris KawaC Offline
              Chris Kawa
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Cobra91151 I hope you actually changed the file name in WINRT_MANIFEST = someManifest.xml.in to your manifest file path and not just copy/pasted this? :)

              Cobra91151C 1 Reply Last reply
              0
              • Chris KawaC Chris Kawa

                @Cobra91151 I hope you actually changed the file name in WINRT_MANIFEST = someManifest.xml.in to your manifest file path and not just copy/pasted this? :)

                Cobra91151C Offline
                Cobra91151C Offline
                Cobra91151
                wrote on last edited by
                #7

                @Chris-Kawa

                Of course I have changed it :)
                I have tied TestUWP23.xml.in, TestUWP23.xml, but windeployqt still 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
                
                1 Reply Last reply
                0
                • Chris KawaC Offline
                  Chris KawaC Offline
                  Chris Kawa
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  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.

                  Cobra91151C 1 Reply Last reply
                  0
                  • Chris KawaC Chris Kawa

                    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.

                    Cobra91151C Offline
                    Cobra91151C Offline
                    Cobra91151
                    wrote on last edited by
                    #9

                    @Chris-Kawa

                    I have found 2 manifest files in Qt directory:

                    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.

                    1 Reply Last reply
                    0
                    • Cobra91151C Offline
                      Cobra91151C Offline
                      Cobra91151
                      wrote on last edited by
                      #10

                      Hello!

                      I have created my own tool called winrtdeploy to copy assets directory and the manifest file from Qt directory.

                      winrtdeploy.exe --source=$$(QTDIR)/bin/assets --destination=$$shell_quote($$DESTDIR) --verbose

                      Now, this issue is resolved.
                      Thank you.

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved