Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding an Skobbler Map to my empty App

I am trying to set up a new Project with Skobbler. I've integrated the SKMaps.jar and put it into the buildpath. I am using AndroidStudio with gradl.

Now the problem is: The moment when I call

SKMaps.getInstance().initializeSKMaps(this, initMapSettings, getString(R.string.skobbler_api_key));

it throws an exception

android.view.InflateException: Binary XML file line #44: Error inflating class com.skobbler.ngx.map.SKMapViewHolder

and

Couldn't load ngnative from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/de.aeins.theswap.swap-1.apk"],nativeLibraryDirectories=[/data/app-lib/de.aeins.theswap.swap-1, /vendor/lib, /system/lib]]]: findLibrary returned null

I've got the lib folder in my project root and inside the SKMaps.jar and the 3 libngnative.so files in the seperate folders.

Any idea what's going wrong?

like image 213
Fabio Schmitz Avatar asked Jun 03 '14 07:06

Fabio Schmitz


2 Answers

I was just having the same issue.

A couple of thoughts (this is how I got it to work)

1) make sure you add the SKMaps.jar file in properties->Java Build Path->Libraries, and that it is selected in Order and Export

2) I realized in the demo app that a bunch of work was being done in the SplashActivity - specifically initializing the library. I assume that this must be done before the layout is inflated in an Activity. I ended up putting a SplashActivity in my app, initializing the library there before going to the Activity that displays the map, and it now works.

like image 131
Britton Peddie Avatar answered Oct 08 '22 08:10

Britton Peddie


I had the same problem. Fixed it by:

  1. Putting lib/armeabi/libngnative.so, lib/armeabi-v7a/libngnative.so and lib/x86/libngnative.so in a zip file.
  2. Rename zipfile to libngnative.jar
  3. Move jarfile to app/libs
  4. Add jarfile as file dependency
like image 33
Erik Avatar answered Oct 08 '22 07:10

Erik