Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-60883

WebView not loading pages from Android assets file system

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.8.0
    • Android, armeabi-v7a
       Qt Creator 4.2.0
       Qt 5.8.0, GCC 4.9
    • Android

    Description

      The QML WebView component fails to load pages from the Android assets virutal file system via the url property. The url used looks like*:*

      assets:/filename.html

      and the actual file is located under android/assets/ and can be found in the .apk archive that is created by qt deployment tool.  

      An error web page is displayed, containing:

      Webpage not available

      The webpage at assets:/filename.html could not be loaded because: net::ERR_UNKNOWN_URL_SCHEME

      Assets file system is the approach I've tried because the documentation states that "Note: The WebView does not support loading content through the Qt Resource system."

      Please note that a QML Image can and will normally display a file from the Android assets system by using a similar url as the one above (example: assets:/image1.png).

      To exemplify, I have attached a small, sample application that uses the Android assets file system to load both an image (play button) and a web page (that uses the youtube API to display the video player).

       

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            stromme Christian
            viktorr14 Victor-Andrei Variu
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes