Wikitude Image Resource loading error

428 views Asked by At

I have created an iOS Project in which I have included an architect world from Wikitudes SDK Examples (Selecting POIs). I followed Wikitude's setup guidelines exactly.

I have made sure to include folder references so the files are accessible in the bundle. My world loads and works exactly like the Wikitude example except that none of the image resources are visible on the screen. The background image, the selected image and any other that I add. I checked for the images in the bundle and they are there under the assets folder.

I have compared the 2 projects and they are exactly the same. I am not able to pinpoint the difference. Is there anything else that has to be done to ensure that images are included? I have tried everything. Please Help!

This is how I have initialized the World

-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
if ( [WTArchitectView isDeviceSupportedForARMode:WTARMode_Geo] ) { // 1

    if ( !_architectView ) {
        self.architectView = [[WTArchitectView alloc] initWithFrame:self.view.bounds];

        [self.architectView initializeWithKey:@"tW3Ht861dC8lNC2/xnahrP7DRI7nqfXDGZfUvdeIGJsc64QLICf0leLIO50svo8me8yrGBcglCEHwAQEhqs8eOceTQ0iXJhF6Glf016W/tDsCSXMetFz4vdZIHzOdNOOBJEKuIEPYZgyffutNigYtdWpPzS33L1OQLoVkdQ3z/NTYWx0ZWRfX21xcPVHf8nkO6IcVarrd+BPN3s78E/Ac39sjGX90LKiVK47DeMMovn5X5X3vXIcwrxe3WRZqL6sczpdObKvll+Qwvpbrnej1ausee5uUCCXFC6oevbcnuWyqgYXzctjCjrJlcdfzL1EgPi9W4i87bnT1uf8IYISiPwBlK7vNvLpBIfryzyn9t4EKMGr5X0GTgXA11G5BJW2wkgukMSt7zp8fE1XurT/C97tTtN9P/w5lyWnpjm/1Qt8n409QxB09A9ZW2x9vcOoTzyCKQyTXduWyhW4hv6gXHZUU5A88PJBGtFpX63f40VURgi+6hMNy2Q4I57Ck0d+NTJHQnPbm2NoHKiAkFr5LS2A91lnhF3BI9Qx8YPpjStPNslW93NJPXOstmSFDLep9MpNx+tLzPMRBj5HLjSTPCzWZSQSuXSj31hc/nwoaVl+0MvQzNC1YQdS1QcjeQx5Ln6nFaW+eCmRHOOAZZQJUJeaVvLSMll+zaYwZ+WrIYDCMx/nCwjtQ7Y+Voj2sivGIxPNrcDUuWul6q2D3WJmUwjquibs2M97lLljwojpgLfRf8hWynpvnfliTgk2OZUT96+vcwLW3FHkCLFteuRQ2g==" motionManager:nil]; // 2
        [self.architectView start];
       [self.view addSubview:self.architectView]; //3

        NSURL * worldURL = [[NSBundle mainBundle] URLForResource:@"index" withExtension:@"html" subdirectory:@"World2"];

        [self.architectView loadArchitectWorldFromUrl:worldURL];

        [self.architectView setShouldRotate:YES toInterfaceOrientation:[UIApplication sharedApplication].statusBarOrientation];

    }
}
}

And this is how I create the Image Resource

World.markerDrawable_idle = new AR.ImageResource("assets/marker_idle.png");
World.markerDrawable_selected = new AR.ImageResource("assets/image2.png");
World.markerDrawable_directionIndicator = new AR.ImageResource("assets/image3.png");
1

There are 1 answers

0
wulfgeng On

How are your folder references set up? You need to make sure that all referenced resources are in the same folder reference as your index.html. If that is the case you can reference them by their relative path.

If they are in different folder references the image resources won't be found.

Your supplied code looks okay to me and if you already have everything inside a single folder reference, the complete project would be helpful.

Disclaimer: I work for Wikitude.