Getting crash when adding a WebView to my Page

  • I am trying to add an Ubuntu.Web.WebView to a test app based off the clickable ut-app-cmake-template from the clickable getting started page. This gave me a simple hello world app. Now I am trying to add a WebView.
    This gives me:

    import QtQuick 2.4                                                                                                                                                                                             
    import QtQuick.Layouts 1.1                                                                                                                                                                                     
    import QtQuick.LocalStorage 2.0                                                                                                                                                                                
    import Ubuntu.Components 1.3                                                                                                                                                                                   
    import Ubuntu.Connectivity 1.0                                                                                                                                                                                 
    import Ubspotplugin 1.0                                                                                                                                                                                        
    import Ubuntu.Web 0.2                                                                                                                                                                                          
    MainView {                                                                                                                                                                                                     
        id: root                                                                                                                                                                                                   
        objectName: 'mainView'                                                                                                                                                                                     
        applicationName: 'ubspot.mungorae'                                                                                                                                                                         
        automaticOrientation: true                                                                                                                                                                                 
        Page {                                                                                                                                                                                                     
            anchors.fill: parent                                                                                                                                                                                   
            header: PageHeader {                                                                                                                                                                                   
                id: header                                                                                                                                                                                         
            WebView {                                                                                                                                                                                              
                id: webView                                                                                                                                                                                        
                url: ""                                                                                                                                                                       
                anchors {                                                                                                                                                                                          
                    left: parent.left                                                                                                                                                                              
                    right: parent.right                                                                                                                                                                            
                    bottom: parent.bottom                                                                                                                                                                          
                    top: loginPage.header.bottom                                                                                                                                                                   
                incognito: true                                                                                                                                                                                    
                preferences.localStorageEnabled: true                                                                                                                                                              
                preferences.allowFileAccessFromFileUrls: true                                                                                                                                                      
                preferences.allowUniversalAccessFromFileUrls: true                                                                                                                                                 
                preferences.appCacheEnabled: true                                                                                                                                                                  
                preferences.javascriptCanAccessClipboard: true                                                                                                                                                     
        Component.onCompleted: Ubspotplugin.speak()                                                                                                                                                                

    But its crashing with:

    Loading module: ''
    LaunchProcess: failed to execvp:
    [0919/] Check failed: ReceiveFixedMessage(fds[0], kZygoteBootMessage, sizeof(kZygoteBootMessage), &boot_pid).
    #0 0x0000ab9e131a <unknown>
    #1 0x0000ab9f043a <unknown>
    #2 0x0000ab2814aa <unknown>
    #3 0x0000ab280a50 <unknown>
    #4 0x0000ab280de0 <unknown>
    #5 0x0000ab091fa6 <unknown>
    #6 0x0000ab095a82 <unknown>
    #7 0x0000ac6aea88 <unknown>
    #8 0x0000aafa6a0c <unknown>
    #9 0x0000ae0b7c86 oxide::qquick::EnsureChromiumStarted()
    #10 0x0000ae0abfbc OxideQQuickWebView::OxideQQuickWebView()
    #11 0x0000ae11eee6 QQmlPrivate::QQmlElement<>::QQmlElement()
    #12 0x0000ae11ef2e QQmlPrivate::createInto<>()

    Wondered if anyone knew what I was doing wrong, or what I should add to get around this?

    Thanks for your consideration.

  • Hi @mungorae ,
    as test i have created a sample app with clickable - -init and template [2]: cmake - C++/QML App, added a WebView like your one and using "clickable --desktop" i have no issues (i have only removed import Ubuntu.Connectivity 1.0 ).
    But, looking around i have found this:
    Seems you are the author of that question... As you say in the question you are building/running an App for exenial (16.04) but in your manifest file you have: "policy_version": 1.3 which is a wrong value.
    Look here for info about how to update manifest and apparmor files to build app for xenial:
    Then try with: "clickable - -xenial" or "clickable --xenial --desktop"
    I'm not sure this solve the issues but i hope can help 🙂

  • haha yeh I am indeed the author of that question. Hadn't found this forum at that time 🙂

    Thank you for your reply @fulvio.
    So I updated my policy version and changed the framework as per the helpful post you linked to. However I do still seem to be getting the same error. My policy file now looks like:

        "policy_groups": [                                                                                                                                                                                         
        "policy_version": 16.04                                                                                                                                                                                    

    I am using clickable ---k 16.04 to run it on a Nexus 5 device.

    From that post I can see mention of a click-review tool, so I installed that and tried to fix any problems. It wanted me to remove debug from policy, so I did that. Now it tells me:

     - lint:architecture_specified_needed
            Could not find compiled binaries for architecture 'armhf'
    build/ FAIL

    Maybe that has got something to do with my crash.

    If its any help the output of clickable -k 16.04 is

    Using docker container "clickable/ubuntu-sdk:16.04-armhf"
    -- The C compiler identification is GNU 5.4.0
    -- The CXX compiler identification is GNU 5.4.0
    -- Check for working C compiler: /usr/bin/arm-linux-gnueabihf-gcc
    -- Check for working C compiler: /usr/bin/arm-linux-gnueabihf-gcc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /usr/bin/arm-linux-gnueabihf-g++
    -- Check for working CXX compiler: /usr/bin/arm-linux-gnueabihf-g++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Found Gettext: /usr/bin/msgmerge (found version "0.19.7") 
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/alex/Projects/ubports/ubspot/build
    Scanning dependencies of target ubspot.desktop
    Scanning dependencies of target Ubspotplugin_automoc
    Scanning dependencies of target ubspot.mungorae.pot
    Scanning dependencies of target ubspot_FILES
    [ 28%] Merging translations into ubspot.desktop...
    [ 28%] Automatic moc for target Ubspotplugin
    [ 28%] Built target ubspot_FILES
    [ 42%] Generating translation template
    Merging translations into ubspot.desktop.
    [ 42%] Built target ubspot.desktop
    [ 42%] Built target ubspot.mungorae.pot
    Generating moc_plugin.cpp
    Generating moc_ubspotplugin.cpp
    [ 42%] Built target Ubspotplugin_automoc
    Scanning dependencies of target Ubspotplugin
    [ 85%] Building CXX object plugins/Ubspotplugin/CMakeFiles/Ubspotplugin.dir/ubspotplugin.cpp.o
    [ 85%] Building CXX object plugins/Ubspotplugin/CMakeFiles/Ubspotplugin.dir/Ubspotplugin_automoc.cpp.o
    [ 85%] Building CXX object plugins/Ubspotplugin/CMakeFile   s/Ubspotplugin.dir/plugin.cpp.o
    [100%] Linking CXX shared module Ubspotplugin/
    [100%] Built target Ubspotplugin
    [ 14%] Merging translations into ubspot.desktop...
    Merging translations into ubspot.desktop.
    [ 14%] Built target ubspot.desktop
    [ 14%] Built target ubspot_FILES
    [ 28%] Generating translation template
    [ 28%] Built target ubspot.mungorae.pot
    [ 42%] Automatic moc for target Ubspotplugin
    [ 42%] Built target Ubspotplugin_automoc
    [100%] Built target Ubspotplugin
    Install the project...
    -- Install configuration: ""
    -- Installing: /home/alex/Projects/ubports/ubspot/build/tmp//manifest.json
    -- Installing: /home/alex/Projects/ubports/ubspot/build/tmp//ubspot.apparmor
    -- Installing: /home/alex/Projects/ubports/ubspot/build/tmp//qml
    -- Installing: /home/alex/Projects/ubports/ubspot/build/tmp//qml/Main.qml
    -- Installing: /home/alex/Projects/ubports/ubspot/build/tmp//assets
    -- Installing: /home/alex/Projects/ubports/ubspot/build/tmp//assets/logo.svg
    -- Installing: /home/alex/Projects/ubports/ubspot/build/tmp//ubspot.desktop
    -- Installing: /home/alex/Projects/ubports/ubspot/build/tmp/lib/arm-linux-gnueabihf/Ubspotplugin/
    -- Installing: /home/alex/Projects/ubports/ubspot/build/tmp/lib/arm-linux-gnueabihf/Ubspotplugin/qmldir
    Successfully built package in './'.
    [100%] /home/phablet/
    Installing files              [=========================]         
    Finished                      [=========================]         
    Installing files              [=========================]         
    Starting                      [=========================]         
    Finished                      [=========================]         
    Installed       ubspot.mungorae-0.1.0.armhf (installed:click,removable=1,app_name=ubspot)   summary goes here

    Interesting that you got it working, though I am deploying to device rather than to desktop.

  • @mungorae please see this to get the full picture of what's going to happen 🙂

  • Hi @mungorae
    to run the application (not deploy it) on desktop try a:
    clickable - -xenial - -desktop
    (or: clickable - -desktop )
    should works (See Getting started section:
    Looking at your last posted output, your app is package successfully as .click package and deployed on your connected phone; so that should run also on desktop.
    (Note: you can RUN the app on the desktop without any device connected; but you can't deploy it on desktop; ".click" package is not supported is only for mobile device).

Log in to reply