QtWebView issue
-
wrote on 16 Feb 2015, 10:34 last edited by
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.
-
wrote on 16 Feb 2015, 13:56 last edited by
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.
-
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.
wrote on 7 Mar 2015, 07:49 last edited by yogeshpatel23 3 Jul 2015, 07:51@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 -
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.
wrote on 7 Mar 2015, 11:47 last edited by redanium 3 Jul 2015, 14:18@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)
-
@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/qt52wrote on 7 Mar 2015, 12:03 last edited by@yogeshpatel23
http://doc.qt.io/qt-5/qtwebview-index.html
The WebView is currently supported on the following platforms: Android and iOS. -
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.