Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-13644

[Windows] "Element not found" exception thrown when launching Windows 8.1 app on Windows 10

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Duplicate
    • None
    • None
    • cordova-windows
    • Windows 10, build 15063.
      Windows 8.1 app build.
      Cordova 7.1.0
      Cordova-windows 5.0.0
      Visual Studio 2015.

    • Patch

    Description

      The following exception is thrown when launching a Windows 8.1 app on Windows 10:

      Exception is about to be caught by JavaScript library code at line 2083, column 9 in ms-appx://com.test/www/cordova.js
      
      0x80070490 - JavaScript runtime error: Element not found.
      

      This occurs due to the addition made in https://issues.apache.org/jira/browse/CB-12238. The check isn't sufficient to account for the use case described above.

      I believe this to be the solution:

      // Make title bg color match splashscreen bg color
      function colorizeTitleBar() {
          var appView = Windows.UI.ViewManagement.ApplicationView.getForCurrentView();
          if (appView.titleBar && (isWin10UWP || isWp10)) {
              titleInitialBgColor = appView.titleBar.backgroundColor;
      
              appView.titleBar.backgroundColor = titleBgColor;
              appView.titleBar.buttonBackgroundColor = titleBgColor;
          }
      }
      
      // Revert title bg color
      function revertTitleBarColor() {
          var appView = Windows.UI.ViewManagement.ApplicationView.getForCurrentView();
          if (appView.titleBar && (isWin10UWP || isWp10)) {
              appView.titleBar.backgroundColor = titleInitialBgColor;
              appView.titleBar.buttonBackgroundColor = titleInitialBgColor;
          }
      }
      

      Attachments

        Issue Links

          Activity

            People

              purplecabbage Jesse MacFadyen
              mac89 Maarten Manders
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: