Possible reasons for a "qrc:/main.qml:-1 File not found" error
-
@Andrey-Shmelew It have been 5.9.1 libs, but yes. The 5.6.2 ones still exist in "/usr/lib".
-
- configure with --prefix "/your/new/path/on/target" (and other options you need)
- make
- make install
- copy resulting directory contents to target into "/your/new/path/on/target"
- set LD_LIBRARY_PATH=/your/new/path/on/target/lib" on target
-
@Andrey-Shmelew I don't know why your error says "qrc:/main.qml" when you try to load your main.qml from the local file system. But I would recommend to load your qmls from the resource system. For your main.qml this would look like this:
view.setSource(QUrl(QStringLiteral("qrc:/main.qml")));
It makes it a lot easier to deploy your app. Since all qml files are compressed and included in your app you just need to copy one file to deploy your app to the target.
-
@DuBu said in Possible reasons for a "qrc:/main.qml:-1 File not found" error:
I don't know
i don't know too...
When i deploy with qt 5.5 it did not complain, and i think, it compressed all qml files and included in my app and loaded all qml files and executable automatically to armhf device.Even if the application is running, I still can not find main.qml file on the device.
-
@Andrey-Shmelew If your really use the files from the resources (what your don't do when you write QUrl::fromLocalFile) it should be hard to find them on the device. I think they got extracted to a temporary folder somewhere no one knows, at least I do. Maybe there's a function to get that path, but I never cared.
I just use two lines of code to make sure to load the qml files from the resource:
(I use QQmlApplicationEngine instead of QQuickView)engine.addImportPath(QStringLiteral("qrc:/")); engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
Additionally you have to make sure to never load components from the local file system (i.e with a Loader).