Error "Import found outside of import paths" in generating apk
-
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 -
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?_=1728224829397The 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.
-
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... -
Fortunately it seems that this bug has been fixed in Qt version 6.8.0
-