Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Qt iOS: access to local .js file
Tycos last edited by
I'm developing an app on multiplatform. In particular my application download on local disk some .js files recalled from the qml-side. Under Android and Linux it's works, but under iOS simulator I've a strange message error:
import "file:script/MyJs.js" as MyJs
error during running:
ASSERT: "!url.isRelative() && (QQmlFile::urlToLocalFileOrQrc(url).isEmpty() || !QDir::isRelativePath(QQmlFile::urlToLocalFileOrQrc(url)))"
This error appears only on iOS simulator (I cannot try on real device for now). Can you help me?
AFAIK, you are trying to do something forbidden on iOS i.e. modifying your app bundle. IIRC download code to run in your application is also something that's forbidden.
You should rather use one of the official accessible folder that you can get through QStandardPaths::AppDataLocation but again, I'm not sure you'll be able to get your application through the AppStore with that download code part.
Hope it helps