Start a new topic

iOS assets not found

Hi everyone,

we've build out first application and there's some issue in the iOS side. Image asset in AR View aren't loadable, while the same files (in Android's resource directories) are loaded and displayed correctly.

The strange part is that audio assets, loaded via "new AR.Sound" are available and play as requested; PNGs and JPGs cannot be found and the following code:


var loaded_img = new AR.ImageResource("assets/images/data/image.png", {
                  onError: function (errorMessage) {
                	alert('error message is: '+errorMessage);
                },
            	onLoaded: function () {
                	alert('image loaded');
               }
     	}
 );

triggers an error as the file cannot be found ("no such file or directory: <path>").

At the end of the message, there is a strange addendum to the error: "Your internet connection appears to be offline", and that shouldn't matter as the resource is local to the bundle.

World.sound_snd = new AR.Sound("assets/sounds/data/sound.mp3",{

 works beautifully.


I cannot pinpoint where the issue should be, if it's path related or it's something else.


Thanks for you help.

Federico

1 Comment

Hi Federico,

Did you put the PNGs/JPGs into an Xcode asset catalog (Can you attach a screenshot of the relevant Xcode project part)?

What is important to know here is that if you use a relative path like shown in your snippet, the files need to be in a 'blue' folder reference in the Xcode project. Our getting started guide demonstrates this in the 'Loading an Architect World' section. So please make sure that the 'assets' folder is a 'blue' folder reference and not a 'yellow' group in the Xcode project. Also the image resources can not be in an Xcode asset catalog.


Best regards,

Andreas



Login or Signup to post a comment