Results 1 to 2 of 2

Thread: [Android] Resolution for NullPointerException : onSurfaceCreated(SourceFile:487)

  1. #1
    Neuer skobbler
    Join Date
    15.09.2014
    Posts
    3

    [Android] Resolution for NullPointerException : onSurfaceCreated(SourceFile:487)

    Hi,

    Implementing Skobbler in my android app, I stucked half an hour with a crash I couldn't understand.
    Following the DemoApp for the initialization part, I kept crashing just before map was displayed with error:

    java.lang.NullPointerException
    at com.skobbler.ngx.map.MapRenderer.onSurfaceCreated( SourceFile:487)
    at android.opengl.GLSurfaceView$GLThread.guardedRun(G LSurfaceView.java:1509)
    at android.opengl.GLSurfaceView$GLThread.run(GLSurfac eView.java:1248)

    As the error wasn't self explanatory at all, I investigated file MapRenderer from package com.skobbler.ngx.map, and found
    that I was crashing because I didn't implement a map listener (this.s, in line below), which classname was trying to be displayed on log.

    Code:
      public final void onSurfaceCreated(GL10 arg1, EGLConfig paramEGLConfig)
      {
          SKLogging.writeLog("MapRenderer", "onSurfaceCreated before LOCK ", 2);
          synchronized (V) {
              SKLogging.writeLog("MapRenderer", "onSurfaceCreated" + this.s.getClass().getName(), 2); // <== Line 487
    You might have forgot to check non-nullity of this.s before logging it, and as it wasn't described as mandatory in your doc to
    implement this listener,I think you should correct that, or otherwise precise it in documentation.

    I think this answer could be useful for other people.

    Thanks for reading.

  2. #2
    Oberskobbler
    Join Date
    22.07.2014
    Posts
    399
    Hi,

    Thank you very much for taking the time to share this with us.
    We will make this improvement in our SDK.

    We are glad to have such great users in our community!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •