Adding a Skobbler map to my empty application

I am trying to create a new project using Skobbler. I turned on SKMaps.jar and put it in the build path. I am using AndroidStudio with gradl.

Now the problem: the moment I call

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

he throws an exception

android.view.InflateException: binary string of XML file # 44: Error bloating class com.skobbler.ngx.map.SKMapViewHolder

and

Failed to load ngnative from the bootloader 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 returns null

I have a lib folder in the root of my project and inside SKMaps.jar and 3 libngnative.so files in separate folders.

Any idea what goes wrong?

+6
source share
4 answers

I had the same problem.

A few thoughts (this is how I earned)

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

2) In the demo application, I realized that a lot of work is being done in SplashActivity - in particular, initializing the library. I suggest that this should be done before the layout is overstated in Activity. I ended up placing SplashActivity in my application, initializing the library there before moving on to an Activity that displays a map, and now it works.

+2
source

I had the same problem. Fixed:

  • Place lib / armeabi / libngnative.so, lib / armeabi-v7a / libngnative.so and lib / x86 / libngnative.so in the zip file.
  • Rename zipfile to libngnative.jar
  • Move jarfile to application / libs
  • Add jarfile as a file dependency
+1
source

In Android Studio projects, your own .so libraries should be located in the / app / src / main / folder for recognition: enter image description here

This may be the cause of your failure. Some similar problems were discovered at stackoverflow.com:

JNI folder in Android Studio

Adding .so file in Android Studio

+1
source

Import the map initialization part into your own activity, which starts initially, as in the SplashActivity application of the Skobler AndroidOpenSourceDemo application. That is, the initialization must be performed in its own launch activity, and from there a new (main) action is launched, showing the map (xmlSmapViewHolder element).

(Also, if in doubt, uninstall the application manually on the device before starting it again.)

+1
source

Source: https://habr.com/ru/post/970224/


All Articles