Start a new topic

Problem with architectView.setLocation

Problem with architectView.setLocation

Hello, I have a problem with Javascript Android SDK

When I enter for the first time wikitude (or after some days), wikitude don't update location with (architectView.setLocation) hen i close the app and open again, all work ok.

I have a breakpoint in setLocation and the first time and following through here.

I have also in the LocationChanged function to write a text on the screen and the first time it doesn't work.


Any idea??


Please have a look at the sample applications and how location is set there.
Most likely you're setting the location before the AR view launch finished so it gets lost.

Speaking of LocationProviders, please also check GooglePlay Service's Location Service, which offer very accurate location fetching features.

Best regards,

Hello again,


The first time I use the application, architectView.setLocation  does not work.


I update location every second I have a log before the method and in LocationChanged  function of js have a updateStatusMessage.


When install the application and open it I can see the log but function js LocationChanged is not executed. I close the application and go back open and everything works ok.


Any suggestions?

This sounds like a life cycle issue.
Please have a look at the SDK Sample application implementation.

Best regards

After many days I found the problem.

In onCreate I open other activity with a message, but this message only appear once a day....


It was driving me crazy


very thx

Hello Juan Luis , 

I have a problem where my application doesn't detect the user's location, could you please show me how did you implement it?


is it a must to contiue calling this architectView.setLocation(latitude, longitude, altitude) in public void onLocationChanged(Location location) listener?

I tried to delay and only called architectView.setLocation ONCE, I only see indicatorDrawable but NOT the GeoObject.

loadPoisFromJsonData: function loadPoisFromJsonDataFn(poiData) function was fired because I added alert('ALT = ' + poiData.altitude + ' LAT = ' + poiData.latitude + ' LONG = ' + poiData.longitude);

var markerObject = new AR.GeoObject(markerLocation, {

            drawables: {

                cam: [markerImageDrawableIdle]




I am following

Latest Version: 9.6 2021-02-23 – 431,7 ΜΒ


We need the setLocation method to be called in order to get the data from any external location resource you want to use.

Did you have a chance to test our current SDK Sample application implementation? It can happen that the GeoObject is not in front of the camera in the beginning, but on the opposite place, behind you.

I would need more information of what you want to achieve and the code you are implementing to help you in more detail.



Hi Aitor

I will retest again my implementation to see is it behind me and get back to you again.

Hi Aitor

I retest my current implementation, no, it is no behind me.

May I know is it a MUST to repeat calling architectView.setLocation(latitude, longitude, altitude)?

Can I ignore all subsequences public void onLocationChanged(Location location) listener callback AFTER I had fired one architectView.setLocation successfully?


Once we have the first location, we can work with it without updating it. Nevertheless, if the device moves its location we won't be able to know about it unless you update it. That's up to you.



hi Aitor,

I am still reviewing what different implementations causes different results.

The implementation in Wikitude SDK after I modify to just fire once, I can see the Geo object.

The almost same implementation in another workspace just cannot see the Geo object.

Do you think the library source I use matter? I cannot verify with Wikitude SDK workspace, it got a build error after I change to implementation 'com.wikitude:js:9.6.0'

implementation project(path: ':wikitude-sdk')
implementation 'com.wikitude:js:9.6.0' 

I have replaced the public void onLocationChanged(Location location) and poiatlocation.js to become identical, still, I cannot get the Geo object shown on phone. An indicator marker is drawn and keep moving/pointing where is the Geo Object but did not show on the screen.


I really cannot find what other causes different result.

Singapore time at 3.33 pm, after clean and rebuild, an ADE menu appears, this is my first time seeing it.


Login or Signup to post a comment