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

Custom icons not working #3536

Closed
Jonfor opened this issue Jan 13, 2016 · 15 comments
Closed

Custom icons not working #3536

Jonfor opened this issue Jan 13, 2016 · 15 comments
Labels
Android Mapbox Maps SDK for Android support

Comments

@Jonfor
Copy link

Jonfor commented Jan 13, 2016

The error, which happens right on the addMarker line:
01-13 12:08:18.627 18751-18751/com.test.test A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 18751 (test.test)

I am running Android 6.0.1.

Here is my what i'm including:

compile('com.mapbox.mapboxsdk:mapbox-android-sdk:3.0.0@aar') {
        transitive = true
}

Here is my code:

private void displayCoords() {
List<LatLng> latLngs = new ArrayList<>();
        Double latTotal = 0.0;
        Double lngTotal = 0.0;

        for (int i = 0; i < list.size(); i++) {
            Obj curr = list.get(i);
            LatLng latLng = new LatLng(curr.getLat(), curr.getLng());
            latLngs.add(latLng);

            IconFactory mIconFactory = IconFactory.getInstance(this);
            Drawable mIconDrawable = ContextCompat.getDrawable(this, R.drawable.ic_directions_boat_black_18dp);
            Icon icon = mIconFactory.fromDrawable(mIconDrawable);

            mapView.addMarker(new MarkerOptions()
                    .title(curr.getName())
                    .snippet(curr.getDescription())
                    .position(latLng)
                    .icon(icon));
}

I have the ic_directions_boat_black folders (drawable-hdpi, drawable-mdpi, etc.) in res/drawable.

Also, your Android tutorial, https://www.mapbox.com/help/first-steps-android-sdk/#getting-started says to use SpriteFactory while your example, https://www.mapbox.com/android-sdk/custom-marker-icon/ uses IconFactory.

@1ec5 1ec5 added the Android Mapbox Maps SDK for Android label Jan 13, 2016
@tobrun
Copy link
Member

tobrun commented Jan 14, 2016

What are the dimensions of ic_directions_boat_black?
Would you be able to share this image with us?
This will probably be related to #3031

@Jonfor
Copy link
Author

Jonfor commented Jan 14, 2016

Sure. it's the same images that you use in the example. https://www.mapbox.com/android-sdk/files/ic_directions_boat_black_18dp.zip

@tobrun
Copy link
Member

tobrun commented Jan 18, 2016

@Jonfor that image should not give any problems.
Could you add a bit more of the stacktrace?

I won't be able to identify the problem by only having this information:

01-13 12:08:18.627 18751-18751/com.test.test A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 18751 (test.test)

@kiwikanji
Copy link

I am having this issue as well.

There is no stack trace and all I get is
01-19 17:01:05.907 31009-31009/com.navico.gofreehooked A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 31009 (co.xxx_myappname)

Any ideas?

@tobrun
Copy link
Member

tobrun commented Jan 20, 2016

This should be fixed with #3561, We are trying to get this in the 3.1.0 release.

@Jonfor @rafjp:
Would you be able to retest when we release the new version?
I will ping you when that happens.

@Jonfor
Copy link
Author

Jonfor commented Jan 20, 2016

Will do.

@kiwikanji
Copy link

yes of course.

Looking forward to it.

On Thu, Jan 21, 2016 at 4:06 AM, Jonathan Forscher <[email protected]

wrote:

Will do.


Reply to this email directly or view it on GitHub
#3536 (comment)
.

@kiwikanji
Copy link

sorry but its still crashing as above.

@tobrun
Copy link
Member

tobrun commented Jan 21, 2016

@rafjp the fix did not land with 3.1.0. You should be able to try out the fix in the upcoming SNAPSHOT.

@kiwikanji
Copy link

great, could you please let me know when it is available for me to test?

@tobrun
Copy link
Member

tobrun commented Jan 25, 2016

@rafjp:
You should be able to test this with the SNAPSHOT:
Checkout these build instructions.

@kiwikanji
Copy link

thanks, I have tested and it has fixed the issues but I am now noticing crashes occurring when performing other operations now which which 3.0 were working.

@tobrun
Copy link
Member

tobrun commented Jan 26, 2016

@rafjp
Thank you for taking the time to retest this.
could you open a new ticket for the other crash?
I really want to know what is going wrong and what we can do to help resolve this.

Closing since the main issue is resolved.

@tobrun tobrun closed this as completed Jan 26, 2016
@kiwikanji
Copy link

"could you open a new ticket for the other crash?" - sorry but we are on a really tight deadline and just do not have the time to help you track down map box issues.

Even upgrading from 3.0 to 3.1 has had to be put on hold due to us experiencing crashes with map box when it had been working OK.

@Jonfor
Copy link
Author

Jonfor commented Feb 1, 2016

I upgraded to version 3.2 and the issue has been fixed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android support
Projects
None yet
Development

No branches or pull requests

5 participants