简体   繁体   English

Titanium appcelerator从资源文件夹中删除sqlite文件?

[英]Titanium appcelerator remove sqlite file from ressource folder?

I want to use titanium appcelerator sqlite features to save my remote datas to database. 我想使用Titanium appcelerator sqlite功能将远程数据保存到数据库。 When i wanto to compile app, my file myDb.sqlite inside ressource folder is deleted by the studio and i get error : 当我想要编译应用程序时,工作室将我的文件myDb.sqlite放入ressource文件夹中,并且出现错误:

[ERROR] :  Script Error {
[ERROR] :      column = 37;
[ERROR] :      line = 18;
[ERROR] :      message = "Could not retrieve attributes";
[ERROR] :      nativeLocation = "-[TiDatabaseProxy install:name:] (TiDatabaseProxy.m:136)";
[ERROR] :      nativeReason = "Error Domain=NSCocoaErrorDomain Code=260 \"The file \U201cremote.sqlite\U201d couldn\U2019t be opened because there is no such file.\" UserInfo={NSFilePath=/Users/esy/Library/Developer/CoreSimulator/Devices/44EEB566-359A-46BD-A456-C13DF1D4CF87/data/Containers/Bundle/Application/B274965B-515E-4785-B17A-AF36A457C034/syncAdapterDemo.app/mydata/remote.sqlite, 

Could you explain why please? 你能解释为什么吗? and where exactly i can store this file ? 我到底可以在哪里存储此文件?

Thank you for help. 谢谢你的帮助。

Is this an alloy app? 这是合金应用吗?

If yes, then I would suggest placing the file in the app/assets folder. 如果是,那么我建议将文件放在app/assets文件夹中。

On build, it will then sit in the root of your project and you can access it as so: 在构建时,它将位于项目的根目录中,您可以这样访问它:

Ti.Database.install('/yourDb.sql', 'yourDb); for install. 安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM