PDA

View Full Version : SKMaps was not initialized after initialize



space0
17.09.2015, 06:35
Hi,

I have one sporadical issue with Skobbler maps. It reproduces infrequently but it happens.
In code I have loader fragment that check SKMaps.getInstance().isSKMapsInitialized() and if not - run initialisation and load map after that.
So Skobbler maps is always initialised when fragment loaded. But sometimes I still get exception com.skobbler.ngx.SKMapsInitializationException: SKMaps was not initialised.
I've tried to add two second delay on case if SKMaps use asynchronous operations, but this does not help.

Full exception trace: http://pastebin.com/zwejJbhW

Adela_Silvia
25.09.2015, 12:28
Have you initialized SKMaps by calling: SKMaps.getInstance().initializeSKMaps(context, mapInitSettings, developerKey)?

If you check the AndroidOpenSourceDemo for Public SDK 2.5, you can see that the path to the mapResources (needed for SDK initialization ) is stored in preferences. So , please do that in your application and call the initialization of the SDK before inflating the SKMapViewHolder:
See the demo MapActivity.java - onCreateMethod :

DemoUtils.initializeLibrary(this);
super.onCreate(savedInstanceState);

setContentView(R.layout.activity_map);

Let us know if this solves the issue.

space0
25.09.2015, 14:40
We are using map in fragment, inside another activity, called from main activity.

As we see after map activity is closed map becomes uninitialized.

Sometimes it happens when activity is paused.

So we have to check this every time for map initialized property.

But even in this case sometimes we get that error.

Adela_Silvia
25.09.2015, 16:35
We'll investigate this and we'll get back when we have updates.

Update[05.11.2015]:
Our developers didn't managed to reproduce your issue.

Related to our previous discussion:
-You've said that map becomes uninitialized- are you calling SKMaps.getInstance().destroySKMaps(); inside the onDestroy() method from MapActivity.java?

-You said also that "sometimes it happens when activity is paused"-the activity/ fragment that uses the SKMapViewHolder has to override it’s methods onPause and onResume and call the corresponding methods of SKMapViewHolder.

In order to replicate your issue please send us a demo project (adding it here or sending it at dev@telenav.com)