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. Type unavailable?

Type unavailable?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
11 Posts 3 Posters 12.5k Views 1 Watching
  • 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.
  • dheerendraD Offline
    dheerendraD Offline
    dheerendra
    Qt Champions 2022
    wrote on last edited by
    #2

    Button unavailable is clear case of the type not found while running. It may be simulator build issue. Can you check your program work perfectly on desktop or android setup on MAC ? Which version of Qt are you using ?

    Dheerendra
    @Community Service
    Certified Qt Specialist
    http://www.pthinks.com

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kgregory
      wrote on last edited by
      #3

      I tried 5.9.2 and 5.8.0. I can try it for desktop when I get a chance (though it wasn't intended for desktop at all).

      What would be the prognosis if it either works or has the same issue on one of the other platforms?

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kgregory
        wrote on last edited by
        #4

        OK I deployed it to desktop and I get the same problem.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kgregory
          wrote on last edited by
          #5

          And just deployed to an actual ipad and also same problem.

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kgregory
            wrote on last edited by
            #6

            This is still killing me. I created a fresh "hello world" app on the mac and it works fine. I compared the .pro file between the working app and my app and couldn't recognize any differences that seem meaningful.

            1 Reply Last reply
            0
            • GTDevG Offline
              GTDevG Offline
              GTDev
              wrote on last edited by
              #7

              Hi!

              So the project was working fine on Windows, the Button.qml (custom qml type?) is there in the app bundle, but it is not found on macOs / iOS when running the app?

              Can you check whether the import path and type name in your QML code, as well as the setup in your QRC file is 100% correct (path names, upper-lowercase mismatch, etc ....)?

              Sounds like the issue could be related to something like that.

              Best,
              GTDev

              Senior Developer at Felgo - https://felgo.com/qt

              Develop mobile Apps for iOS & Android with Qt
              Felgo is an official Qt Technology Partner

              1 Reply Last reply
              0
              • K Offline
                K Offline
                kgregory
                wrote on last edited by
                #8

                Yes, Button.qml is a custom type. I cloned the whole repo over to the mac using git.

                In the .pro file, the QML_IMPORT_PATH has nothing assigned. I assume this means that it should only look in the base directory, which is where all of the files are, including Button.qml. I saw something in documentation about unix systems being case sensitive, but my naming follows it's recommendation, which is to capitalize the first letter. It is capitalized the same way in both the .qml file that calls it and in the name of Button.qml itself. I spent some time playing with different combinations of capitalization last night without any success.

                I'm wondering if there is something in my .pro file that was not generated on the windows version of Creator since it is unable to target iOS but is necessary in order to do so on the mac. For example, the rules for deployment (below) doesn't appear to have anything for iOS but maybe it falls under the unix rule?

                # Default rules for deployment.
                qnx: target.path = /tmp/$${TARGET}/bin
                else: unix:!android: target.path = /opt/$${TARGET}/bin
                !isEmpty(target.path): INSTALLS += target
                

                There are also some variables defined in the .pro file which appear to only reference android and there is no equivalent for iOS. For example, the following.

                DISTFILES += \
                    android/AndroidManifest.xml \
                    android/gradle/wrapper/gradle-wrapper.jar \
                    android/gradlew \
                    android/res/values/libs.xml \
                    android/build.gradle \
                    android/gradle/wrapper/gradle-wrapper.properties \
                    android/gradlew.bat
                
                ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
                
                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  kgregory
                  wrote on last edited by
                  #9

                  What's the easiest way to print out the import path?

                  According to http://doc.qt.io/qt-5/qtqml-syntax-imports.html, the import path always includes the current file directory. Since I have all of my source files in the same directory together, I don't see how it could be missed.

                  1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    kgregory
                    wrote on last edited by
                    #10

                    Interesting... I just tried targeting desktop from the windows machine and found this problem in that case as well. So perhaps the windows/mac aspect was a red herring. Why does this work for Android but for nothing else?

                    1 Reply Last reply
                    0
                    • K Offline
                      K Offline
                      kgregory
                      wrote on last edited by
                      #11

                      Well after trying all sorts of different things to try to solve this issue, I finally solved it by renaming Button to something else. Go figure...

                      Then, of course, I ran into the next issue, which is that the bluetooth doesn't connect on iOS. I'm about ready to throw this macbook out the window.

                      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