I'm playing around with the new ACS (Cloud services)
When I'm testing in my iOS-simulator everything works like a charm.
But when I open in Xcode and run the project on a real device (iPhone) I get this error: [ERROR] Script Error = Couldn't find module: ti.cloud.
My tiapp.xml have both acs-api-keys, acs-oauth-keys etc. and of cause:
<modules> <module platform="commonjs" version="2.0.1">ti.cloud</module> </modules>
Is this a bug? Others having this issue ?
Only on real devices I have this problem. In simluator everything is smooth! Other projects that does not use the new Cloud-services have no problem compiling and working on real device.
It seems like the ti.cloud.js file that is in the example folder of the module must be in the resources folder of the app for it to work in the device. Strangely even if its not there the app works in the simulator.
Works with sdk 2.1 and ti.cloud module 2.0.1 WITH THE ti.cloud.js file IN THE RESOURCES FOLDER
Also version 2.1 of the ti.cloud module does not work in simulator or app - tested against sdk 2.0 2.0.1, 2.0.2 and 2.1. I have had to use version 2.0.1 of the t.cloud module
Do you have the ti.cloud module in your project? If not, please try creating a modules folder in the Resources folder of your project and place ti.cloud there. Also, I noticed you have platform as "commonjs". Should it not be "iphone"?
do i have to put ti.cloud.js in resources of the Xcode project aswell? Still doesn't work...
I'm sorry but I have the same issue and I don't know where can I find this ti.cloud.js file ?
I am having the same issue.
How exactly are you including it in your app? Are you using require() or Ti.Include()?
I have added modules under Resources folder which has ti.cloud.js. I still get the ti.cloud not found error.Is there anything else to be done ?
First you need to enable cloud services on your project using the tiapp.xml, which I'm guessing you did. Now add the line
var Cloud = require('ti.cloud');to your app.js file. You must also add that line to your other .js files if they are working from a different context/heavy window. After that you can call everything like they do using
Cloud.blabla....There is no need, as far as I can tell, to add the module. But if you do make sure you call it correctly by pointing to the correct folder like
var Cloud = require('../../modules/ti.cloud');If you don't understand where the ../../ is coming from spend a few minutes and learn how to navigate around a linux terminal using the cd command. You'll never EVER regret learning that.
I had a similar problem: using the cloud services only in a separate API module (to abstract the cloud services) didn't work on the device, though it worked fine in the simulator.
Make sure that you are loading ti.cloud in the main context [like app.js], as opposed to only in other modules.
Loading the ti.cloud module in app.js (in addition to my app.js file) fixed the problem for me.
When you create a new project, check "enable cloud". This will add hash keys and a few other lines in your tiapp.xml. So, if you have already started a project, create a new one and compare the two. You'll see 6 lines up top for Oauth, etc. and one towards the end such as this:
<modules> <module platform="commonjs" version="2.3.0">ti.cloud</module> </modules>This may help some people.
Think you can help? Login to answer this question!