Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Problem with custom Plugin for QtQuick on iOS
QtWS25 Last Chance

Problem with custom Plugin for QtQuick on iOS

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qtquickiospluginqt5.8
8 Posts 4 Posters 4.2k 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.
  • S Online
    S Online
    shav
    wrote on 24 Jan 2017, 22:43 last edited by
    #1

    Hi,

    I'm using Qt 5.8 on macOS 10.12.3 and iOS 10.2. I have a project which usage custom QtQuick plugin. I can build this plugin without any issues. Also this plugin work fine for Desktop. When I try to build my iOS application with this plugin (which I build for iOS) I receive error message:

    Starting remote process.
    objc[7095]: Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x115039998) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x114db8880). One of the two will be used. Which one is undefined.
    QML debugging is enabled. Only use this in a safe environment.
    JIT is disabled for QML. Property bindings and animations will be very slow. Visit https://wiki.qt.io/V4 to learn about possible solutions for your platform.
    QQmlApplicationEngine failed to load component
    qrc:/main.qml:3 module "com.shav.uicomponents" plugin "ShavUIComponents" not found
    

    As you can see my plugins can't be found.

    After build my plugin I'm coping it to Qt_instal_dir/5.8/ios/qml folder. This work for Desktop version of my project but doesn't work for iOS. Could someone post step-by-step instruction how to deploy custom plugins for iOS platform?

    Mac OS and iOS Developer

    1 Reply Last reply
    0
    • S Online
      S Online
      shav
      wrote on 20 Feb 2017, 17:04 last edited by
      #2

      Hi everyone!

      I still have problem with my QML plugin on iOS. I'm using special variable to see what happens with imports path and this is what I see in console:

      Starting remote process.
      objc[4611]: Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x1160d6998) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x115e55880). One of the two will be used. Which one is undefined.
      QML debugging is enabled. Only use this in a safe environment.
      QQmlImportDatabase::addImportPath: "/Users/andrewshapovalov/Library/Developer/CoreSimulator/Devices/C6439E02-F21C-4BCE-80A7-884741DF6D63/data/Containers/Bundle/Application/D44C51FF-9AA9-4EC7-9015-1A003ADE5176/NestleanInstaller.app/qt_qml"
      QQmlImportDatabase::addImportPath: "qrc:/qt-project.org/imports"
      QQmlImportDatabase::addImportPath: "/Users/andrewshapovalov/Library/Developer/CoreSimulator/Devices/C6439E02-F21C-4BCE-80A7-884741DF6D63/data/Containers/Bundle/Application/D44C51FF-9AA9-4EC7-9015-1A003ADE5176/NestleanInstaller.app"
      JIT is disabled for QML. Property bindings and animations will be very slow. Visit https://wiki.qt.io/V4 to learn about possible solutions for your platform.
      QQmlImportDatabase::addImportPath: "/Volumes/HPDD/Applications/Qt/Qt5.x/5.8/ios/qml"
      QQmlImports(qrc:/qml/main.qml)::addLibraryImport: "QtQuick" 2.7 as ""
      QQmlImports(qrc:/qml/main.qml)::importExtension: loaded "/Volumes/HPDD/Applications/Qt/Qt5.x/5.8/ios/qml/QtQuick.2/qmldir"
      QQmlImportDatabase::registerPluginTypes: "QtQuick" from "/Volumes/HPDD/Applications/Qt/Qt5.x/5.8/ios/qml/QtQuick.2"
      QQmlImports(qrc:/qml/main.qml)::addLibraryImport: "QtQuick.Controls" 1.5 as ""
      QQmlImports(qrc:/qml/main.qml)::importExtension: loaded "/Volumes/HPDD/Applications/Qt/Qt5.x/5.8/ios/qml/QtQuick/Controls/qmldir"
      QQmlImportDatabase::registerPluginTypes: "QtQuick.Controls" from "/Volumes/HPDD/Applications/Qt/Qt5.x/5.8/ios/qml/QtQuick/Controls"
      QQmlImports(qrc:/qml/main.qml)::addLibraryImport: "QtQuick.Controls" 2.0 as ""
      QQmlImports(qrc:/qml/main.qml)::importExtension: loaded "/Volumes/HPDD/Applications/Qt/Qt5.x/5.8/ios/qml/QtQuick/Controls.2/qmldir"
      QQmlImportDatabase::registerPluginTypes: "QtQuick.Controls" from "/Volumes/HPDD/Applications/Qt/Qt5.x/5.8/ios/qml/QtQuick/Controls.2"
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      qmlRegisterType requires absolute URLs.
      QQmlImports(qrc:/qml/main.qml)::addLibraryImport: "QtGraphicalEffects" 1.0 as ""
      QQmlImports(qrc:/qml/main.qml)::importExtension: loaded "/Volumes/HPDD/Applications/Qt/Qt5.x/5.8/ios/qml/QtGraphicalEffects/qmldir"
      QQmlImportDatabase::registerPluginTypes: "QtGraphicalEffects" from "/Volumes/HPDD/Applications/Qt/Qt5.x/5.8/ios/qml/QtGraphicalEffects"
      QQmlImports(qrc:/qml/main.qml)::addLibraryImport: "com.shav.uicomponents" 1.0 as ""
      QQmlImports(qrc:/qml/main.qml)::importExtension: loaded "/Volumes/HPDD/Applications/Qt/Qt5.x/5.8/ios/qml/com/shav/uicomponents/qmldir"
      QQmlApplicationEngine failed to load component
      qrc:/qml/main.qml:6 module "com.shav.uicomponents" plugin "ShavUIComponents" not found
      

      If I understand correctly application is loaded my plugin but still can't use it.

      How I can fix this?

      Mac OS and iOS Developer

      1 Reply Last reply
      0
      • V Offline
        V Offline
        VeNToR
        wrote on 30 Mar 2017, 23:39 last edited by
        #3

        I have same problem. Did you solve ?

        1 Reply Last reply
        0
        • S Online
          S Online
          shav
          wrote on 31 Mar 2017, 06:08 last edited by
          #4

          Hi,

          Not yet. Still working on it. But if you find something let me know.

          Mac OS and iOS Developer

          V 1 Reply Last reply 31 Mar 2017, 19:18
          0
          • S shav
            31 Mar 2017, 06:08

            Hi,

            Not yet. Still working on it. But if you find something let me know.

            V Offline
            V Offline
            VeNToR
            wrote on 31 Mar 2017, 19:18 last edited by
            #5

            @shav Sure !

            1 Reply Last reply
            0
            • L Offline
              L Offline
              ldanzinger
              wrote on 3 Apr 2017, 19:20 last edited by
              #6

              I hit this issue and Qt support told me that for iOS, in order to include my custom plugins with the app, I need to add this to my pro file - QMLPATHS += /path/to/plugin

              It is some sort of undocumented qmake variable I guess. It is only required on iOS from my testing.

              1 Reply Last reply
              0
              • S Online
                S Online
                shav
                wrote on 3 Apr 2017, 19:51 last edited by
                #7

                Thanks for the reply!

                I'm tested it and still have the same problem. Your plugin is a static library, right?

                Mac OS and iOS Developer

                1 Reply Last reply
                0
                • C Offline
                  C Offline
                  cbdg
                  wrote on 24 Mar 2018, 10:28 last edited by
                  #8

                  Build Qt qml plugin for iOS (static plugin)

                  1. Plugin Pro file like flow:
                    TEMPLATE = lib
                    TARGET = iostestqmlplugin
                    QT += qml quick
                    CONFIG += qt plugin c++11 static
                    uri = IosQmlPluginTest # module name
                    QMAKE_MOC_OPTIONS += -Muri=$$uri # static plugin must use this

                  2.qmldir file
                  module IosQmlPluginTest
                  plugin iostestqmlplugin
                  typeinfo plugins.qmltypes #static plugin required
                  classname IosqmlpluginPlugin # static plugin must set classname for plugin c++ class

                  TimeLabel 1.0 qrc:/TimeLabel.qml # your self qml document

                  3.qrc file must contains qmldir file, Qt default put qmldir in qrc file with prefix likes: “/qt-project.org/imports/your-plugin-modele-name”, You can special yourself prefix but must endwiths “your-plugin-module-name” and in main cpp need add addImportPath(eg: engine.addImportPath(“qrc:/your-self-prefix-not-contains-your-plugin-module-name”))

                  4.put plugins.qmltypes, qmldir and plugin library files together into where Qt install dir’s sub fold name qml($$[QT_INSTALL_QML] Qt default serach path), maybe you can special yourself path in your app pro file by variable QMLPATHS(QMLPATHS += /your/plugin/path)

                  1. Init the plugin resources(contains qmldir) at plugin c++ class construction function like:Q_INIT_RESOURCE(your-qrc-file-name);

                  6.pulugins.qmltypes file it’s required. can gernerate by qmlplugindup tool.

                  7.refrence QtWebView plugin project from Qt source

                  usually error:
                  1.static plugin for module “QtQuick” with name “your-module-name” has no metadata URI
                  fix by add in pro file:QMAKE_MOC_OPTIONS += -Muri=$$URI #URI = your-module-name
                  thanks from:https://github.com/wang-bin/QtAV/issues/368

                  2.Plugin “your-module-name” is missing a classname entry
                  fix by add in qmldir file: classname your-plugin—c++-name
                  Reference http://doc.qt.io/qt-5.6/qtqml-modules-qmldir.html

                  1. module “your-plugin-module-name” is not installed
                    fix by: Qmldir file must in plugin qrc file, plugins.qmltypes need in the plugin dir and special in qmldir
                  1 Reply Last reply
                  1

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved