Start a new topic

AR is not defined at null:1

AR is not defined at null:1

i'm currently developing an app for android OS using android studio and wikitude 4.0.3 sdk. when i run the sample app, it works fine. but when i run my app i'm getting some errors. camera view is openning without any problems. but sometimes that also not opening.instead of opening the camera view it just show trial word on a black screen. first error is "AR is not defined at null:1". and im getting another two errors on my chrome console. i have attached images of my logcat, chrome console and android studio project structure. please if anyone can identify the problem, guide me to solve it.

Thank you! 
Did you include the architect.js file in your project?

 Thank you Gabriele for replying. yeah architect.js file is available within wikitudesdk.jar. and according to wikitude documentation i have included <script src="architect://architect.js"></script> in my ARView.html file. but problem exists. in my ARViewJS.js file i implement the ARworld which i want to augment on camera i doing something wrong? please provide a proper way of including architect.js if im wrong.

Thanks in advance!

Maybe you are including the architect.js file after the other JS files? The AR object definition is inside this file, so if any other file is included before, Javascript won't be able to find the definition. If not, please, could you post some code, to help us reproduce your problem?

Thank you for helping this much. script order is correct in .html file. i have sovled "failed to load resource" problem which is showing in initial chrome console image(in my first post to this forum). But still "GET architect://architect.js net::ERR_UNKNOWN_URL_SCHEME" is exists. i have attached images of .html file, chrome console, onCreate method, onPostCreate method. i think errors related to ade.js(which are showing in chrome console) are not considerable for the app since ade.js is used to check the errors in our js code using browser console. 

Thank you!

An AR world cannot be opened by a normal browser, but only inside an AR application using the wikitude SDK.

If you want to have a debug view of the objects in an AR world, you should include the file "ade.js" that came with the SDK package.

yeah i can understand the usage of ade.js script. that is fine. but why "AR" is not recognizing as an object?

I see from your screenshots that you are trying to open an AR world on your Windows hard disk. This won't work on an Android device, you should specify a relative path inside your assets directory. See the sample application if you need more details.

ok i looked at those samples and the thing is that im a newbie to the android development,java language and wikitude sdk. so that i cant usderstand how the relative path is given in your exaples. :(
could you please explain with a little example how to provide relative path in to the load method and in to other relavent places?

Thank you! 

You can just import the sample application source code and use that as a starting point.

well thanks for your help. now i solved the path problem and app can access to the html file without any problem. but im getting another couple of errors. i have attached 
an image of most recent logcat of the project 

Thank you! 

Hi, it's not easy to understand your problem from this log, this is just an image, does not contain the full log, and the relevant line is incomplete.

However, I see that your variable "imageResource" is undefined, maybe you are accessing it out of scope in Javascript, or you defined it with another name. Can you post some javascript code, so that we can reproduce your problem?
Login or Signup to post a comment