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.

onMapReady not getting called when offline #4486

Closed

Description

@tnightingale

When running on my tablet (Nexus 9, Android 6) with WiFi disabled before opening the application. The map loads if there is an offline region available or ambient cache but the onMapReady() callback is not fired after mapView.getMapAsync() is called.

I'm seeing this in my own application and in the Android test application. On both the current gradle/maven SNAPSHOT release and the latest master branch built from source.

There seem to be some similar issues floating around:

And maybe a fix here?

Though I still encounter this on the SNAPSHOT build - would that not include the changes made in #4462?

Activity

  1. added
    Android
    on Mar 28, 2016
  2. added this to the android-v4.0.0 milestone on Mar 28, 2016
  3. jfirebaugh commented on Mar 28, 2016

    @jfirebaugh
    Contributor

    Is this different than #4393 in some way?

  4. tnightingale commented on Mar 28, 2016

    @tnightingale
    Author

    @jfirebaugh only that it is happening using both the default streets and emerald styles and not a custom style. I see someone else has reported something similar over there too. Happy to close if it is duplicate.

  5. zugaldia commented on Mar 28, 2016

    @zugaldia
    Member

    @tnightingale I just tried ambient caching and offline download for the default mapbox://styles/mapbox/streets-v8 in the TestApp in branch release-ios-3.2.0-android-4.0.0 and, in both cases, I'm seeing the Map is ready message show in the logs. Just to clarify, your experience is that you don't see this message (or any code inside the OnMapReadyCallback), is that right?

    Could you check again making sure your cache is clean? You might be hitting an old SNAPSHOT that doesn't include the latest fixes.

  6. tnightingale commented on Mar 28, 2016

    @tnightingale
    Author

    My test case is as follows:

    Put breakpoints on the following two lines:

    1. Call to mMapView.getMapAsync()
    2. first line of onMapReady()

    Uninstall any existing versions of the 'Mapbox GL' test app.

    Ensure WiFi is disabled on the tablet (or Airplane mode is enabled).

    Build and run MapboxGLAndroidSDKTestApp with the Android Studio debugger and load the OfflineActivity and observe:

    1. Execution pauses on breakpoint 1.
    2. I press 'continue' expecting execution to eventually pause on breakpoint 2.
    3. Nothing (map view remains black as I haven't any cached or offline tiles).

    Kill application process and enable WiFi and repeat: Both breakpoints are hit and (I assume) some tiles are cached.

    Kill application process again, disable WiFi and repeat: Only first breakpoint is hit.

    I have just pulled the latest version of the release-ios-3.2-android-4.0.0 branch and will retry the above steps once it has finished building.

  7. tnightingale commented on Mar 28, 2016

    @tnightingale
    Author

    I have just performed the above test with latest release-ios-3.2-android-4.0.0 built from source and execution is pausing on breakpoint 2 as expected after some tiles are in the cache.

    My guess is that last night I was testing with a stale version of the SNAPSHOT release?

    Just to clarify as I am not familiar with the inner-workings of maven repositories: How often is the SNAPSHOT release updated? Is it always building the latest version of whatever repository branch it is pointing at?

  8. zugaldia commented on Mar 28, 2016

    @zugaldia
    Member

    @tnightingale thank you very much for your efforts testing this. If I understand you well, with the latest code from the release-ios-3.2.0-android-4.0.0 branch you're no longer seeing this problem with stock styles. This seems to indicate that we might be seeing the same situation as in #4393.

    No worries about the SNAPSHOT process, let me elaborate. We basically build those nightly out of master. Because we're now in the middle of a release process and we've already cut a release branch (the one mentioned above), we're now building those SNAPSHOTs nightly off of the release branch. That means a SNAPSHOT is very close to what the final release looks like and pretty safe to try. Once we release, we'll build again off of master. I hope this helps.

    I'm closing this now as a duplicate of #4393 but please do reopen if you find this issue again.

  9. tnightingale commented on Mar 28, 2016

    @tnightingale
    Author

    Yes things appear to be functioning as expected using stock styles and running both the SNAPSHOT release and the latest code from release-ios-3.2.0-android-4.0.0 branch.

    Thanks for the help :)

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

    Android

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions