Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Offline downloading blocking return of mapboxMap object #11461

Closed

Description

@cammace

Using the Map SDK 5.5.0 if you download a region, leave the activity and return to the same activity with the mapView, the OnMapReady callback gets held up by what I assume is an attempt to read the "file source".

03-15 14:29:11.505 5222-5222/com.mapbox.mapboxsdk.plugins.testapp E/FileSource: Failed to read the storage key: 
                                                                                java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.os.Bundle.getBoolean(java.lang.String, boolean)' on a null object reference
                                                                                    at com.mapbox.mapboxsdk.storage.FileSource.getCachePath(FileSource.java:69)
                                                                                    at com.mapbox.mapboxsdk.storage.FileSource.getInstance(FileSource.java:48)
                                                                                    at com.mapbox.mapboxsdk.maps.MapView.onStart(MapView.java:349)
                                                                                    at com.mapbox.mapboxsdk.plugins.offline.ui.RegionSelectionFragment.onStart(RegionSelectionFragment.java:97)
                                                                                    at android.support.v4.app.Fragment.performStart(Fragment.java:2287)
                                                                                    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1458)
                                                                                    at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1750)
                                                                                    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1819)
                                                                                    at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3227)
                                                                                    at android.support.v4.app.FragmentManagerImpl.dispatchStart(FragmentManager.java:3186)
                                                                                    at android.support.v4.app.FragmentController.dispatchStart(FragmentController.java:203)
                                                                                    at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:582)
                                                                                    at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:177)
                                                                                    at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1334)
                                                                                    at android.app.Activity.performStart(Activity.java:7019)
                                                                                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2741)
                                                                                    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
                                                                                    at android.app.ActivityThread.-wrap11(Unknown Source:0)
                                                                                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
                                                                                    at android.os.Handler.dispatchMessage(Handler.java:106)

Eventually, the callback is invoked, a MapboxMap object is available but no map style is loaded (only the background).

ezgif com-video-to-gif

cc: @mapbox/maps-android

Activity

  1. added
    Android
    on Mar 15, 2018
  2. LukasPaczos commented on Mar 16, 2018

    @LukasPaczos
    Contributor

    @cammace could you ensure that there is no other native stack trace before the one you posted? I've seen a situation when NullPointerException: Attempt to invoke virtual method 'boolean android.os.Bundle.getBoolean(java.lang.String, boolean)' on a null object reference was thrown just after a native crash.

  3. cammace commented on Mar 19, 2018

    @cammace
    ContributorAuthor

    Can confirm that i'm not seeing any native crashes, @tobrun mentioned this could be related to #11147.

  4. dylan-chong commented on Jun 25, 2018

    @dylan-chong

    Sorry to bug you all but is this bug still being worked on?

    Also did anyone find any workarounds while this bug is still being fixed?

  5. neslihanturan commented on Jul 30, 2018

    @neslihanturan

    We also get very similar error on another project which uses mapbox. Is it a bug that is caused from mapbox-android or do we misinterpret logs? If so, did you find a solution for this?

  6. tobrun commented on Aug 13, 2018

    @tobrun
    Member

    OnMapReady invocation is linked to style loading which is blocked as the queue in filesource is filled up with offline resources that will be handled first. In #12219 we have a solution outlined that decouples OnMapReady invocation from style loading.

  7. tobrun commented on Aug 15, 2018

    @tobrun
    Member

    @neslihanturan @dylan-chong
    would you be able to retest with a more recent version? eg 6.3.0 (6.4.0 will be released later today) In gif below I'm downloading a large region on application start (clean install), while the map takes a couple seconds to load, it shows as expected:

    ezgif com-video-to-gif 29

  8. tobrun commented on Aug 16, 2018

    @tobrun
    Member

    While in 6.4.0 this issue seems less apparant, it is still there. Fixing this issue at core level is ticketed in #12655. Closing this issue as the solution for this issue is outlined in #12655.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Androidoffline

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions