Error message : Could not find the file

You must Login before you can answer or comment on any questions.

Hello,

I've got this error when I test my app :

Could not find the file presentation.js

Here is the code I've got in my app.js :

Titanium.UI.setBackgroundColor('#000');
 
var tabGroup = Titanium.UI.createTabGroup();
 
var win1 = Titanium.UI.createWindow({  
    title:'Présentation',
    url:'views/presentation.js',
    backgroundColor:'#fff'
});
 
var tab1 = Titanium.UI.createTab({  
    icon:'KS_nav_views.png',
    title:'Tab 1',
    window:win1
});
 
tabGroup.addTab(tab1);
 
tabGroup.open();
Here is a screencapture of my workspace :

alt text

9 Answers

Accepted Answer

If you're using Titanium Studio try this: Go to Project -> Clean -> Select your project (or select to clean all projects) -> Click Ok.

This will force a fresh build (and will remove your old compiled files and generate new ones). This will take a while.

Regards.

I think the app.js must be in the parent folder of other presentation.js. A good idea is to write:

var win1 = Titanium.UI.createWindow({  
    title:'Présentation',
    url:  Ti.Filesystem.resourcesDirectory + 'views/presentation.js',
    backgroundColor:'#fff'
});

hi xavier :) Try adding "/" in url path..

var win1 = Titanium.UI.createWindow({  
    title:'Présentation',
    url:'/views/presentation.js',
    backgroundColor:'#fff'
});

Same error... :-(

Here is the full error :

[ERROR] error loading path: /Users/MAC/Library/Application Support/iPhone Simulator/4.3/Applications/017FF1EE-51B7-4205-94BC-1C2A5C59CA8D/test.app/views/portfolio.js, Error Domain=NSCocoaErrorDomain Code=260 "The operation couldn’t be completed. (Cocoa error 260.)" UserInfo=0x6d41410 {NSFilePath=/Users/MAC/Library/Application Support/iPhone Simulator/4.3/Applications/017FF1EE-51B7-4205-94BC-1C2A5C59CA8D/test.app/views/portfolio.js, NSUnderlyingError=0x6d469f0 "The operation couldn’t be completed. No such file or directory"}

Sorry Rainer, but what do you mean about the "build folder" ?

— answered 5 months ago by xavier pixelgamma
answer permalink
1 Comment
  • Rainer wants to say that try to clean and build your project means remove the content from that build/iphone or build/android and try running your app again.

    — commented 5 months ago by Yogin Bhungalia

[ERROR] error loading path: /Users/MAC/Library/Application Support/iPhone Simulator/4.3/Applications/017FF1EE-51B7-4205-94BC-1C2A5C59CA8D/test.app/views/presentation.js, Error Domain=NSCocoaErrorDomain Code=260 "The operation couldn’t be completed. (Cocoa error 260.)" UserInfo=0x6e38180 {NSFilePath=/Users/MAC/Library/Application Support/iPhone Simulator/4.3/Applications/017FF1EE-51B7-4205-94BC-1C2A5C59CA8D/test.app/views/presentation.js, NSUnderlyingError=0x6e37ca0 "The operation couldn’t be completed. No such file or directory"}

I don't understand why it's searching the folder/file called views/presentation.js in /Users/MAC/Library/Application Support/iPhone Simulator/4.3/Applications/017FF1EE-51B7-4205-94BC-1C2A5C59CA8D/test.app/ because the files are located in Macintosh HD/Utilisateurs/MAC/Documents/Titanium Studio Workspace/test

alt text

— answered 5 months ago by xavier pixelgamma
answer permalink
2 Comments
  • basically this should work like how you are trying. url:'views/presentation.js', but it's giving error and if there is some problem or bug than just give a try to all ways path like,

    url:'/views/presentation.js',

    url:'./views/presentation.js',

    url:'../views/presentation.js',

    This is not real solution. It should work like how you are trying but as it not working that way so just give a try to all this way.

    — commented 5 months ago by Yogin Bhungalia

  • It may sound crazy :)

    — commented 5 months ago by Yogin Bhungalia

Ok, I've got to delete the build folder (on the top) each time I add a file/folder in my app. It's a bit strange, it should be a bug...

Hi,

i faced the same issue.. 1)try cleaning the project 2)try to run in previous mobile sdk versions (as iam using 1.8.0.1)

and it worked fine..

Your Answer

Think you can help? Login to answer this question!