简体   繁体   中英

Wikitude SDK project derived from samples doesn't work

I've been modifying the sample projects Wikitude SDK provides, and I'm facing a problem: it seems like this code never works:

this.tracker = new AR.Tracker("/assets/magazine.wtc", {
    onLoaded: this.worldLoaded
});

That is, the world never loads, so the function "worldLoaded" is never called. I have no idea why the world doesn't load as the file is the original provided in the samples and it used to work. The difference seems to be trivial, I only added a new member to the World variable that would define some additional parameteres.

The error I get is

Uncaught TypeError: Cannot read property 'apply' of undefined 
ade.js:1AR.i.__executeFunctionByName ade.js:1AR.i.callAsync ade.js:1l

Any idea how to tackle this?

It seems as if you have the ADE activated, which is not necessary on a mobile device. In your HTML, please delete the line (your path to ade.js might differ slightly). This will make the error go away.

In addition, my suggestion is to also add an onError event to the tracker. In this case, you'll be notified when the tracker cannot be loaded (wrong location specified, invalid file etc), and you can react accordingly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM