Start a new topic

NullPointerException in ArchitectWebView.removeJSInterfaces()

NullPointerException in ArchitectWebView.removeJSInterfaces()

Hi guys,

Here's another rare crash we're facing using the Android Wikitude SDK:


E/AndroidRuntime(18723): FATAL EXCEPTION: main

E/AndroidRuntime(18723): java.lang.RuntimeException: Unable to pause activity {com.skyhookwireless.apps.arinflight/com.s

kyhookwireless.apps.arinflight.PoiViewActivity}: java.lang.NullPointerException

E/AndroidRuntime(18723):        at

E/AndroidRuntime(18723):        at

E/AndroidRuntime(18723):        at

E/AndroidRuntime(18723):        at$800(

E/AndroidRuntime(18723):        at$H.handleMessage(

E/AndroidRuntime(18723):        at android.os.Handler.dispatchMessage(

E/AndroidRuntime(18723):        at android.os.Looper.loop(

E/AndroidRuntime(18723):        at

E/AndroidRuntime(18723):        at java.lang.reflect.Method.invokeNative(Native Method)

E/AndroidRuntime(18723):        at java.lang.reflect.Method.invoke(

E/AndroidRuntime(18723):        at$

E/AndroidRuntime(18723):        at

E/AndroidRuntime(18723):        at dalvik.system.NativeStart.main(Native Method)

E/AndroidRuntime(18723): Caused by: java.lang.NullPointerException

E/AndroidRuntime(18723):        at com.wikitude.architect.ArchitectWebView.removeJSInterfaces(Unknown Source)

E/AndroidRuntime(18723):        at com.wikitude.architect.ArchitectWebView.onPauseArchitect(Unknown Source)

E/AndroidRuntime(18723):        at com.wikitude.architect.ArchitectView.onPause(Unknown Source)


Could you please guide us to the problem cause?


Hi there!

This sound kinda special.

Are you sure you handled life-cycle callbacks properly?

Do you have same issue in SimpleARBrowser sample?


Hi Andreas,

I don't think we can reproduce this issue with SimpleARBrowser, it doesn't happen constantly even with our application.

Which lifecycle callbacks are we talking about?

Hi again,

Life-cycle methods are all the on*-Methods, like onResume(), onPause()...
It is very important to forward all your Activity's life-cycle calls to the architectView.
E.g. when you called onDestroy() in your Activity and reenter it but forgot to call onCreate() but call onResume() the architectView is in an inconsistent state, which usually causes unexpected errors, like the one you described.

Please have a close look at the samples in the SDK's "Android"-folder and ensure to not forget any of these calls.


Hi Andreas,

Yes, I know that we should call the on*-methods sequentially, they are tied to the corresponding activity methods in our case. The described problem however may come from the legacy version where onResume has been called in async mode and could probably interfere with onPause (even that they both are executed on the ui thread?). I'll check if we don't have this problem now after removing the async mode from onResume.

Shouldn't it be IllegalStateException in that case anyway like in other cases where the on*-method calls are mixed up?
Login or Signup to post a comment