1

I am trying to use the wikitude-sdk-sample-image-recogn image recognition sample code which uses the wikitude Javscript SDK, to test how the image recognition feature works, when i run the code on my android phone i get this error enter image description here

This is the code which errors out,

try{
        var targetCollectionResource = new AR.TargetCollectionResource(
   "/01_ImageRecognition_1_ImageOnTarget/assets/magazine.wtc", {
   onLoaded:function(){
    AR.logger.info("LOADED");
   },
   onError:function(err){
    AR.logger.info(`Error on target collection: ${err.message}`);
   }
        });
}catch (er) {
   AR.logger.error(er.message);
   
}

for some reason the its not recognising the TargetCollectionResource from the Wikitude SDK API Reference

Adam
  • 2,418
  • 3
  • 17
  • 22
  • It seems like you are specifying an absolute path for your .wtc which is probably incorrect, try to use a relative path from your html file instead. There is currently a known issue in the sdk where the onError message is not a valid string which causes an error in js which could explain why your catch block is triggered. – Someone Apr 18 '17 at 07:42

1 Answers1

0

I hope you would have resolved this issue... but even though sharing the solution with you.

Solution - issue was due to requiredFeatures is not set for the WTArchitectView as WTFeature_ImageTracking. I hope this will solve your issue.

eg - [WTArchitectView isDeviceSupportedForRequiredFeatures:WTFeature_ImageTracking|WTFeature_Geo error:&deviceSupportError];