title: Skobbler map stays black on Android
body: <p>I followed the Android tutorial for Skobbler which can be found here: </p>
  
  <p><a href="http://developer.skobbler.com/getting-started/android" rel="nofollow noreferrer">http://developer.skobbler.com/getting-started/android</a></p>
  
  <p>In my app, I cannot use the SKMapFragment because I need a android.support.v4.app.Fragment for the rest of my apps logic. This is why I went for the SKMapViewHolder method.</p>
  
  <p>My fragment code looks like this:</p>
  
  <pre><code>import android.graphics.Bitmap;
  import android.os.Bundle;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  
  import com.skobbler.ngx.map.SKAnnotation;
  import com.skobbler.ngx.map.SKCoordinateRegion;
  import com.skobbler.ngx.map.SKMapCustomPOI;
  import com.skobbler.ngx.map.SKMapPOI;
  import com.skobbler.ngx.map.SKMapSurfaceListener;
  import com.skobbler.ngx.map.SKMapSurfaceView;
  import com.skobbler.ngx.map.SKMapViewHolder;
  import com.skobbler.ngx.map.SKPOICluster;
  import com.skobbler.ngx.map.SKScreenPoint;
  
  import nl.afdelingapps.android.boschxp.R;
  import nl.afdelingapps.android.boschxp.view.BaseFragment;
  import nl.afdelingapps.android.boschxp.helper.SkobblerHelper;
  
  /**
   * Created by bartburg on 27-10-2015.
   */
  public class RouteMapFragment extends BaseFragment implements SKMapSurfaceListener {
  
      private SKMapViewHolder mapViewGroup;
      private SKMapSurfaceView mapView;
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          View inflatedView = inflater.inflate(R.layout.fragment_skobbler, container, false);
          mapViewGroup = (SKMapViewHolder) inflatedView.findViewById(R.id.map_surface_holder);
          mapViewGroup.setMapSurfaceListener(this);
          return inflatedView;
      }
  
      @Override
      public boolean getForceRefresh() {
          return false;
      }
  
      @Override
      public String getFragmentName() {
          return "CenterMapFragment";
      }
  
      @Override
      public void onPause() {
          super.onPause();
          if (mapView != null) {
              mapView.onPause();
          }
      }
  
      @Override
      public void onResume() {
          super.onResume();
          if (mapView != null) {
              mapView.onResume();
          }
      }
  
      @Override
      public void onActionPan() {
  
      }
  
      @Override
      public void onActionZoom() {
  
      }
  
      @Override
      public void onSurfaceCreated(SKMapViewHolder skMapViewHolder) {
          mapView = mapViewGroup.getMapSurfaceView();
          mapView.applySettingsFromFile(SkobblerHelper.getMapCreatorFilePath(getContext()));
      }
  
      @Override
      public void onMapRegionChanged(SKCoordinateRegion skCoordinateRegion) {
  
      }
  
      @Override
      public void onMapRegionChangeStarted(SKCoordinateRegion skCoordinateRegion) {
  
      }
  
      @Override
      public void onMapRegionChangeEnded(SKCoordinateRegion skCoordinateRegion) {
  
      }
  
      @Override
      public void onDoubleTap(SKScreenPoint skScreenPoint) {
  
      }
  
      @Override
      public void onSingleTap(SKScreenPoint skScreenPoint) {
  
      }
  
      @Override
      public void onRotateMap() {
  
      }
  
      @Override
      public void onLongPress(SKScreenPoint skScreenPoint) {
  
      }
  
      @Override
      public void onInternetConnectionNeeded() {
  
      }
  
      @Override
      public void onMapActionDown(SKScreenPoint skScreenPoint) {
  
      }
  
      @Override
      public void onMapActionUp(SKScreenPoint skScreenPoint) {
  
      }
  
      @Override
      public void onPOIClusterSelected(SKPOICluster skpoiCluster) {
  
      }
  
      @Override
      public void onMapPOISelected(SKMapPOI skMapPOI) {
  
      }
  
      @Override
      public void onAnnotationSelected(SKAnnotation skAnnotation) {
  
      }
  
      @Override
      public void onCustomPOISelected(SKMapCustomPOI skMapCustomPOI) {
  
      }
  
      @Override
      public void onCompassSelected() {
  
      }
  
      @Override
      public void onCurrentPositionSelected() {
  
      }
  
      @Override
      public void onObjectSelected(int i) {
  
      }
  
      @Override
      public void onInternationalisationCalled(int i) {
  
      }
  
      @Override
      public void onBoundingBoxImageRendered(int i) {
  
      }
  
      @Override
      public void onGLInitializationError(String s) {
  
      }
  
      @Override
      public void onScreenshotReady(Bitmap bitmap) {
  
      }
  }
  </code></pre>
  
  <p>So really nothing fancy. BaseFragmentis just an abstract class with nothing fancy. Actually just some Google Analytics stuff and logging stuff, nothing more and it's not used for this fragment yet.</p>
  
  <p>My fragment xml is just like in the tutorial:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:mapbox="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:layout_marginTop="?attr/actionBarSize"&gt;
      &lt;com.skobbler.ngx.map.SKMapViewHolder
          android:id="@+id/map_surface_holder"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>I followed every step and the map stays black. I tested this on Android 4.3, 5.1 and 6.0. It's black on all screens.</p>
  
  <p>My gradle file:</p>
  
  <pre><code>buildscript {
      repositories {
          maven { url 'https://maven.fabric.io/public' }
      }
  
      dependencies {
          classpath 'io.fabric.tools:gradle:1.+'
      }
  }
  apply plugin: 'com.android.application'
  apply plugin: 'io.fabric'
  apply plugin: 'com.google.gms.google-services'
  
  repositories {
      maven { url 'https://maven.fabric.io/public' }
  }
  
  
  android {
      compileSdkVersion 23
      buildToolsVersion "23.0.1"
  
      defaultConfig {
          applicationId "nl.afdelingapps.android.boschxp"
          minSdkVersion 16
          targetSdkVersion 23
          versionCode 11
          versionName "1.0"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      compile fileTree(include: ['*.jar'], dir: 'libs')
      testCompile 'junit:junit:4.12'
      compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
          transitive = true;
      }
      compile('com.mapbox.mapboxsdk:mapbox-android-sdk:2.2.0@aar') {
          transitive = true
      }
      compile 'com.qozix:tileview:2.0.8'
      compile 'com.google.code.gson:gson:2.4'
      compile 'com.google.android.gms:play-services-panorama:8.3.0'
      compile 'com.android.support:appcompat-v7:23.1.1'
      compile 'com.android.support:design:23.1.1'
      compile 'com.android.support:support-v4:23.1.1'
      compile 'uk.co.chrisjenx:calligraphy:2.1.0'
      compile 'com.jakewharton:butterknife:7.0.1'
      compile 'com.github.ksoichiro:android-observablescrollview:1.6.0'
      compile 'com.google.android.gms:play-services-analytics:8.3.0'
      compile 'de.greenrobot:eventbus:2.4.0'
      compile 'de.greenrobot:java-common:2.2.0'
      compile 'com.squareup.picasso:picasso:2.5.2'
      compile 'com.estimote:sdk:0.9.4@aar'
      compile project(':widgetsystem')
  }
  
  repositories {
      maven {
          url "http://developer.skobbler.com/maven/"
      }
  }
  
  configurations {
      skobblersdk
  }
  dependencies {
      skobblersdk "com.skobbler.ngx:SKMaps:2.5.1"
      compile files('libs/SKMaps.jar')
  }
  
  def assetsPath = "$projectDir/src/main/assets"
  def libsPath = "$projectDir/libs"
  def jniLibsPath = "$projectDir/src/main/jniLibs"
  
  dependencies {
      compile 'com.android.support:support-v4:23.+'
  }
  dependencies {
      compile 'com.android.support:support-v4:23.+'
  }
  task installSKMaps &lt;&lt; {
      copy {
          from configurations.skobblersdk
          into "$buildDir/skobblersdk-down"
          rename { String fileName -&gt; 'skobblersdkres.zip' }
      }
      copy {
          from zipTree("$buildDir/skobblersdk-down/skobblersdkres.zip")
          into "$buildDir/skobblersdk-down"
      }
      delete("$jniLibsPath",
              "$assetsPath/SKMaps.zip",
              "$libsPath/SKMaps.jar")
      copy {
          from "${buildDir}/skobblersdk-down/jniLibs"
          into "$jniLibsPath"
      }
      copy {
          from "${buildDir}/skobblersdk-down/SKMaps.zip"
          into "$assetsPath"
      }
      copy {
          from "${buildDir}/skobblersdk-down/SKMaps.jar"
          into "$libsPath"
      }
      delete("$buildDir/skobblersdk-down")
      delete(configurations.skobblersdk)
  }
  </code></pre>
  
  <p>And a screenshot:</p>
  
  <p><a href="https://i.stack.imgur.com/V12eR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/V12eR.png" alt="screenshot black skobbler map"></a></p>
  
  <p>My logs shows at least something goes wrong in background:</p>
  
  <pre><code>02-12 11:15:18.207 16085-16085/nl.afdelingapps.android.boschxp W/System.err: java.lang.NoSuchMethodError: no non-static method "Lcom/skobbler/ngx/positioner/SKPosition;.getLatitude()D"
  02-12 11:15:18.212 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at java.lang.Runtime.nativeLoad(Native Method)
  02-12 11:15:18.212 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at java.lang.Runtime.doLoad(Runtime.java:435)
  02-12 11:15:18.212 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at java.lang.Runtime.loadLibrary(Runtime.java:370)
  02-12 11:15:18.212 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at java.lang.System.loadLibrary(System.java:1076)
  02-12 11:15:18.212 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at com.skobbler.ngx.SKMaps.&lt;clinit&gt;(SourceFile:59)
  02-12 11:15:18.212 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at nl.afdelingapps.android.boschxp.view.activity.MainActivity.onMapTexturesPrepared(MainActivity.java:349)
  02-12 11:15:18.212 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at com.skobbler.ngx.SKPrepareMapTextureThread$1.run(SourceFile:92)
  02-12 11:15:18.212 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at android.os.Handler.handleCallback(Handler.java:739)
  02-12 11:15:18.212 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:95)
  02-12 11:15:18.212 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at android.os.Looper.loop(Looper.java:148)
  02-12 11:15:18.212 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:5417)
  02-12 11:15:18.212 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
  02-12 11:15:18.212 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
  02-12 11:15:18.212 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
  02-12 11:15:18.212 16085-16085/nl.afdelingapps.android.boschxp D/SkobblerNG: gJVM registerMethod error for ClassSKPosition :: getLatitude ()D
  02-12 11:15:18.212 16085-16085/nl.afdelingapps.android.boschxp W/System.err: java.lang.NoSuchMethodError: no non-static method "Lcom/skobbler/ngx/positioner/SKPosition;.getLongitude()D"
  02-12 11:15:18.212 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at java.lang.Runtime.nativeLoad(Native Method)
  02-12 11:15:18.212 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at java.lang.Runtime.doLoad(Runtime.java:435)
  02-12 11:15:18.212 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at java.lang.Runtime.loadLibrary(Runtime.java:370)
  02-12 11:15:18.212 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at java.lang.System.loadLibrary(System.java:1076)
  02-12 11:15:18.212 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at com.skobbler.ngx.SKMaps.&lt;clinit&gt;(SourceFile:59)
  02-12 11:15:18.212 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at nl.afdelingapps.android.boschxp.view.activity.MainActivity.onMapTexturesPrepared(MainActivity.java:349)
  02-12 11:15:18.212 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at com.skobbler.ngx.SKPrepareMapTextureThread$1.run(SourceFile:92)
  02-12 11:15:18.212 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at android.os.Handler.handleCallback(Handler.java:739)
  02-12 11:15:18.212 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:95)
  02-12 11:15:18.213 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at android.os.Looper.loop(Looper.java:148)
  02-12 11:15:18.213 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:5417)
  02-12 11:15:18.213 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
  02-12 11:15:18.213 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
  02-12 11:15:18.213 16085-16085/nl.afdelingapps.android.boschxp W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
  </code></pre>