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.

[Android] [JNI] [Crash] Application crush when using ResourceTransformCallback #8580

Closed

Description

@amotzg

Platform: Android x86 emulator API level 23 (latest Studio/SDK version).
Mapbox SDK version: 5.0.1

Steps to trigger behavior

  1. Add to the map Activity OnCreate FileSource.getInstance(this).setResourceTransform(this);
  2. Make Activity implement FileSource.ResourceTransformCallback by simply returning one valid URL for any onUrl() call.

Expected behavior

All tiles use data retrived from the location returned by onUrl().

Actual behavior

Application crush while asking transition for the first tile.

Studio project and logcat attached.
Need to add access token to project as I've removed mine. Also, although this code never reached, the URL returned by onURL() is only meaningful on my setup.

170330__logcat_mb_resource_transform.txt
resource_transform_tester.tar.gz

Before testing on a clean application, I attempted resource transform on my project with integrated MapBox SDK source. Having the source, debugger stop on getting the callback from FileSource::ResourceTransformCallback::javaClass inside FileSource::ResourceTransformCallback::onURL.

screenshot_2017-03-30_12-34-59

Activity

  1. added
    Android
    on Mar 30, 2017
  2. self-assigned this
    on Mar 30, 2017
  3. ivovandongen commented on Mar 30, 2017

    @ivovandongen
    Contributor

    @amotzg Thanks for the report and the reproduction project. Very helpful!

    There is a problem with the thread on which the callback is executed, this is solved in #8582. However, given your example, there is another issue. You use the activity as the callback, this will leak the activity once it goes out of scope. Be sure to use either a) a static inner class or b) to de-register the callback on Activity#onDestroy

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

Metadata

Metadata

Assignees

Labels

Androidcrash

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions