Qt World Summit: Register Today!


qml web view does not display html content if set target android 29 in 5.12.4 version



  • If set android target Android 28, works.
    If set android target Android 29, display nothing, and webview.runjavascript does not work.

    There is no error , no exception, even the webview progress shows 10-100, all works, only does not display html content.

    5.12.4
    QtWebView 1.1



  • The problem ist this here.

    Example

    chromium: [INFO:CONSOLE(18)] "WebSocket connection to 'ws://localhost:12345/' failed: Error in connection establishment: net::ERR_CLEARTEXT_NOT_PERMITTED", source: file:///balbalbla/js/blubber.js (18)
    

    Quote from another website

    In order to view remote documents from an HTTP URL, cleartext network traffic support is required. On Android 9.0 (API level 28) or higher,
    cleartext support is disabled by default and apps targeting Android 9.0 or higher will need to add the android:usesClearTextTraffic="true" flag in the AndroidManifest.xml file.
    If you are only working with HTTPS files, this flag is not required.

    To get it work add this to the Android Manifest.xml in section Application.

    android:usesCleartextTraffic="true"
    

    Example AndroidManifest.xml

    Example

    <application android:usesCleartextTraffic="true" android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication blablablabla
    

Log in to reply