Start a new topic

NullPointerException in InstantTracker using SMART

I am trying to use instant scene tracking like the samples. I want to set the device height above the ground using a default variable, for example 0.1 (so i just removed the seekbar) but i get NullPointerException. The message is:

Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'void com.wikitude.tracker.InstantTracker.setDeviceHeightAboveGround(float)' on a null object. 

 The code is same as the sample. I just removed seek bar and i wrote :

mInstantTracker.setDeviceHeightAboveGround(10 / 100.f);

What am i doing wrong? If i comment this line, the code works perfectly.

Hi Zisi,

Could you please tell me if you are testing with Android or iOS?



I am testing in Android. 


it seems like you are calling setDeviceHeightAboveGround before the tracker was created. Please make sure that you only use any methods of the InstantTracker after TrackerManager.createInstantTracker.

If you want to create the tracker with this device height above ground you can create an InstantTrackerConfiguration set it there and then pass this configuration to TrackerManager.createInstantTracker.

Best Regards,


Login or Signup to post a comment