UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Getting crash when adding a WebView to my Page

    Scheduled Pinned Locked Moved App Development
    5 Posts 3 Posters 831 Views 1 Watching
    Loading More Posts
    • 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.
      • M Offline
        mungorae
        last edited by

        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                                                                                                                                                                                 
                                                                                                                                                                                                                       
            width: units.gu(45)                                                                                                                                                                                        
            height: units.gu(75)                                                                                                                                                                                       
                                                                                                                                                                                                                       
            Page {                                                                                                                                                                                                     
                anchors.fill: parent                                                                                                                                                                                   
                                                                                                                                                                                                                       
                header: PageHeader {                                                                                                                                                                                   
                    id: header                                                                                                                                                                                         
                    title: i18n.tr('UBSpot')                                                                                                                                                                           
                }                                                                                                                                                                                                      
                                                                                                                                                                                                                       
                WebView {                                                                                                                                                                                              
                    id: webView                                                                                                                                                                                        
                    url: "http://www.google.com"                                                                                                                                                                       
                                                                                                                                                                                                                       
                    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: 'libubuntu_application_api_touch_mirclient.so.3.0.0'
        LaunchProcess: failed to execvp:
        /usr/lib/arm-linux-gnueabihf/oxide-qt/chrome-sandbox
        [0919/232725:FATAL:zygote_host_impl_linux.cc(182)] 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.

        1 Reply Last reply Reply Quote 0
        • F Offline
          fulvio
          last edited by fulvio

          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: https://stackoverflow.com/questions/52415263/crash-when-using-webview-on-ubuntu-touch-xenial#
          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: https://forums.ubports.com/topic/1215/updating-apps-to-16-04
          Then try with: "clickable - -xenial" or "clickable --xenial --desktop"
          I'm not sure this solve the issues but i hope can help 🙂

          1 Reply Last reply Reply Quote 2
          • M Offline
            mungorae
            last edited by

            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": [                                                                                                                                                                                         
                    "networking",                                                                                                                                                                                          
                    "connectivity",                                                                                                                                                                                        
                    "content_exchange",                                                                                                                                                                                    
                    "content_exchange_source",                                                                                                                                                                             
                    "usermetrics",                                                                                                                                                                                         
                    "webview",                                                                                                                                                                                             
                    "keep-display-on",                                                                                                                                                                                     
                    "audio",                                                                                                                                                                                               
                    "video"                                                                                                                                                                                                
                ],                                                                                                                                                                                                         
                "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:

            Warnings
            --------
             - lint:architecture_specified_needed
                    Could not find compiled binaries for architecture 'armhf'
            build/ubspot.mungorae_0.1.0_armhf.click: 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.
            Wrote ubspot.desktop.in.h
            [ 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/libUbspotplugin.so
            [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
            Wrote ubspot.desktop.in.h
            [ 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/libUbspotplugin.so
            -- Installing: /home/alex/Projects/ubports/ubspot/build/tmp/lib/arm-linux-gnueabihf/Ubspotplugin/qmldir
            Successfully built package in './ubspot.mungorae_0.1.0_armhf.click'.
            [100%] /home/phablet/ubspot.mungorae_0.1.0_armhf.click
            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.

            F 1 Reply Last reply Reply Quote 0
            • advocatuxA Offline
              advocatux
              last edited by

              @mungorae please see this https://forums.ubports.com/post/12942 to get the full picture of what's going to happen 🙂

              1 Reply Last reply Reply Quote 0
              • F Offline
                fulvio @mungorae
                last edited by

                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: http://clickable.bhdouglass.com/en/latest/getting-started.html)
                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).

                1 Reply Last reply Reply Quote 1
                • First post
                  Last post