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. QtWebView issue

QtWebView issue

Scheduled Pinned Locked Moved Mobile and Embedded
6 Posts 5 Posters 3.7k 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.
  • F Offline
    F Offline
    Flamaros
    wrote on last edited by
    #1

    I am trying integrate a webview in our application, it works well under Windows, but I have some issue to make it works on Android.

    I have the following error message:
    @
    Main.qml:2:1: module "QtWebView" is not installed
    @

    I don't understand cause the minibrowser sample works fine.

    For Windows I use a component with import QtWebkit 3.0 and import QtWebView 1.0 for Android.
    It seems the issue come from the generated manifest that doesn't contains:
    @
    jar/QtAndroidWebView.jar:jar/QtAndroidWebView-bundled.jar for the meta data android.app.load_local_jars
    @

    That the only difference I found between the minibrowser sample and our application.

    PS :
    I add:
    @
    qtHaveModule(webengine) {
    QT += webengine
    DEFINES += QT_WEBVIEW_WEBENGINE_BACKEND
    }
    @

    in our .pro file and:

    @
    #ifdef QT_WEBVIEW_WEBENGINE_BACKEND
    QtWebEngine::initialize();
    #endif // QT_WEBVIEW_WEBENGINE_BACKEND
    @

    After the QGuiApplication creation.

    I certainly missed something, but I don't see what.

    yogeshpatel23Y redaniumR 2 Replies Last reply
    0
    • F Offline
      F Offline
      Flamaros
      wrote on last edited by
      #2

      I tried to modify the manifest directly but it doesn't solve the issue.

      libQt5WebView.so
      libqml_QtWebView_libdeclarative_webview.so
      Are still missing in the apk.

      If I add them in my apk (with 7-zip), I just can't install it.

      1 Reply Last reply
      0
      • F Flamaros

        I am trying integrate a webview in our application, it works well under Windows, but I have some issue to make it works on Android.

        I have the following error message:
        @
        Main.qml:2:1: module "QtWebView" is not installed
        @

        I don't understand cause the minibrowser sample works fine.

        For Windows I use a component with import QtWebkit 3.0 and import QtWebView 1.0 for Android.
        It seems the issue come from the generated manifest that doesn't contains:
        @
        jar/QtAndroidWebView.jar:jar/QtAndroidWebView-bundled.jar for the meta data android.app.load_local_jars
        @

        That the only difference I found between the minibrowser sample and our application.

        PS :
        I add:
        @
        qtHaveModule(webengine) {
        QT += webengine
        DEFINES += QT_WEBVIEW_WEBENGINE_BACKEND
        }
        @

        in our .pro file and:

        @
        #ifdef QT_WEBVIEW_WEBENGINE_BACKEND
        QtWebEngine::initialize();
        #endif // QT_WEBVIEW_WEBENGINE_BACKEND
        @

        After the QGuiApplication creation.

        I certainly missed something, but I don't see what.

        yogeshpatel23Y Offline
        yogeshpatel23Y Offline
        yogeshpatel23
        wrote on last edited by yogeshpatel23
        #3

        @Flamaros :
        As I know webkit is not supported for Android yet. You have to use JNI (Java Native Interface) for that.

        Reference:
        http://qt-project.org/qt5/qt52

        Thanks,
        Yogesh

        J 1 Reply Last reply
        0
        • F Flamaros

          I am trying integrate a webview in our application, it works well under Windows, but I have some issue to make it works on Android.

          I have the following error message:
          @
          Main.qml:2:1: module "QtWebView" is not installed
          @

          I don't understand cause the minibrowser sample works fine.

          For Windows I use a component with import QtWebkit 3.0 and import QtWebView 1.0 for Android.
          It seems the issue come from the generated manifest that doesn't contains:
          @
          jar/QtAndroidWebView.jar:jar/QtAndroidWebView-bundled.jar for the meta data android.app.load_local_jars
          @

          That the only difference I found between the minibrowser sample and our application.

          PS :
          I add:
          @
          qtHaveModule(webengine) {
          QT += webengine
          DEFINES += QT_WEBVIEW_WEBENGINE_BACKEND
          }
          @

          in our .pro file and:

          @
          #ifdef QT_WEBVIEW_WEBENGINE_BACKEND
          QtWebEngine::initialize();
          #endif // QT_WEBVIEW_WEBENGINE_BACKEND
          @

          After the QGuiApplication creation.

          I certainly missed something, but I don't see what.

          redaniumR Offline
          redaniumR Offline
          redanium
          wrote on last edited by redanium
          #4

          @Flamaros
          Hi, did you include this in your main.cpp ???

          #ifdef QT_WEBVIEW_WEBENGINE_BACKEND
          #include <QtWebEngine>
          #endif // QT_WEBVIEW_WEBENGINE_BACKEND
          

          for me it's working on android (Htc Desire , kitkat 4.4)

          1 Reply Last reply
          0
          • yogeshpatel23Y yogeshpatel23

            @Flamaros :
            As I know webkit is not supported for Android yet. You have to use JNI (Java Native Interface) for that.

            Reference:
            http://qt-project.org/qt5/qt52

            J Offline
            J Offline
            jalomic
            wrote on last edited by
            #5

            @yogeshpatel23
            http://doc.qt.io/qt-5/qtwebview-index.html
            The WebView is currently supported on the following platforms: Android and iOS.

            1 Reply Last reply
            1
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi,

              There's something that needs some clarification here:
              on iOS and Android, neither QtWebKit nor QtWebEngine are supported since both platforms enforces the use of their own provided web element.

              Here enters the QtWebView module which is not the same thing as the QtWebKit QWebView nor the QtWebEngine QWebEngineView. QtWebView provides a minimal wrapper around the native web view of both platforms.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              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