Start a new topic
Solved

(XAMARIN) Java.Lang.NullPointerException: Attempt to invoke virtual method 'com.wikitude.common.PlatformService com.wikitude.common.services.internal.ServiceManagerInternal.getService(java.lang.String)' on a null object reference

The problem appears as follows:
1) I open the application and execute the augmented reality.
2) I return to the menu or put it in the background.
3) I try to re-run the augmented reality and I get the following error:


 "Error:

Unhandled Exception:

Java.Lang.NullPointerException: Attempt to invoke virtual method 'com.wikitude.common.PlatformService com.wikitude.common.services.internal.ServiceManagerInternal.getService(java.lang.String)' on a null object reference"

 

The error is presented in the following line, in the same way I attach an image for your greater understanding.

this.architectView.SetLocation(loc.Latitude, loc.Longitude, loc.Altitude);


I am using a samsung galaxy S7 and an Asus Zenfone 2 to perform the tests, in both terminals I get the same error.


Code:

https://github.com/sergioalejserrano/AR-Xamarin-2


I await your response thank you very much


Captura.PNG
(61.2 KB)
1 Comment

Hi Sergio,

Can it be that you call `SetLocation` before `onPostCreate` or after `onDestroy`? You can only call `SetLocation` after our SDK was fully initialised and before it's destructed.


Best regards,

Andreas

Login or Signup to post a comment