Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Error "Import found outside of import paths" in generating apk
Forum Updated to NodeBB v4.3 + New Features

Error "Import found outside of import paths" in generating apk

Scheduled Pinned Locked Moved Solved Installation and Deployment
4 Posts 2 Posters 415 Views 2 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.
  • FalsinSoftF Offline
    FalsinSoftF Offline
    FalsinSoft
    wrote on last edited by
    #1

    Hi all

    I have a very strange but bloking error in my project. I created a CMake project to build an android apk. I added all my qml and the .js file but when the build process start to scan for dependencies the error "Import found outside of import paths" came up and is refer always to the js file. Only to this file. Checking the generated android-MyApp-deployment-settings.json I noted the problem is generated by the fact in the field "qml-root-path" is always added also the cmake root path (like c:\MyProject) and this have as consequence that the qmlimportscanner tool scan for all subfolders inastead of scan only in the subfolder I passed containing my surces. If I manually remove the cmake root path from json file the error disappeared (but since this json file is autogenerated every time cmake changes is quite boring the make change manuaally every time). Someone faced this error before and can suggest some workaround? Another alternative is to avoid is some way to camke root path added by default to "qml-root-path" json field. Also set the QT_QML_ROOT_PATH doesn't halp cause it only add the selected path the "qml-root-path" list...
    Thank you

    1 Reply Last reply
    0
    • A Offline
      A Offline
      ankou29666
      wrote on last edited by ankou29666
      #2

      Hi

      Makes me remember one week of headaches. I faced this issue some time ago.
      https://forum.qt.io/topic/143251/android-build-import-found-outside-of-import-paths?_=1728224829397

      The the real cause is not intuitive given the error message, but if it's the same problem the fix is easy : just remove any space in your path, and all should build smooth after that.

      1 Reply Last reply
      0
      • FalsinSoftF Offline
        FalsinSoftF Offline
        FalsinSoft
        wrote on last edited by
        #3

        Hi
        At first thank you for your reply. Before post I checked the forum for similar issues and already found your post however there are no spaces in my paths. The problem is different unfortuately. To add some info to my problem I can say if I change the name of my .js file by starting with some letter like 'z' the error disapper. It seems that, for some strange reasons, that if the deploing tool find this particilar .js file as first generate the error...

        1 Reply Last reply
        0
        • FalsinSoftF Offline
          FalsinSoftF Offline
          FalsinSoft
          wrote on last edited by
          #4

          Fortunately it seems that this bug has been fixed in Qt version 6.8.0

          1 Reply Last reply
          0
          • FalsinSoftF FalsinSoft has marked this topic as solved on

          • Login

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