Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Android SDK 30 WebView requires setAllowFileAccess(true) to view local files

Android SDK 30 WebView requires setAllowFileAccess(true) to view local files

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 3 Posters 950 Views
  • 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.
  • I Offline
    I Offline
    imp1953
    wrote on 8 Nov 2021, 22:16 last edited by
    #1

    Changing from SDK 29 to 30 results in an Access Denied error when viewing a local file with WebView.
    The local files are created dynamically as required, they are not static assets.

    The solution is to call WebView.getSettings().setAllowFileAccess(true); on the Android webview as allowFileAccess is now false by default in SDK 30.

    Does anyone know if this can be set without having to build my own version of QtAndroidWebView ? Even then I am not sure it is straight-forward as the setting may need to be applied after loading.

    Alternately, is there a location where local files can be written that are readable by webView without this setting?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Augustas
      wrote on 23 Nov 2021, 11:00 last edited by Augustas
      #2

      I'm also having the same issue, can't find a way to set WebView "AllowFileAccess" flag to true on Qt

      M 1 Reply Last reply 17 Dec 2021, 14:45
      0
      • A Augustas
        23 Nov 2021, 11:00

        I'm also having the same issue, can't find a way to set WebView "AllowFileAccess" flag to true on Qt

        M Offline
        M Offline
        Marek
        wrote on 17 Dec 2021, 14:45 last edited by
        #3

        @Augustas HI
        any success with that ?

        Best Regards
        Marek

        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