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

[Android] IllegalArgumentException: R array length must be 3 or 4 with Samsung Device #9745

Closed
kfadli opened this issue Aug 10, 2017 · 5 comments
Labels
Android Mapbox Maps SDK for Android

Comments

@kfadli
Copy link

kfadli commented Aug 10, 2017

Hello, i'm encountering an issue with Samsung Galaxy S4 (GT-I9505) and Android 4.3.

Fatal Exception: java.lang.IllegalArgumentException: R array length must be 3 or 4 at android.hardware.SensorManager.getRotationMatrixFromVector(SensorManager.java:1336) at com.mapbox.mapboxsdk.maps.widgets.MyLocationView$CompassListener.onSensorChanged(MyLocationView.java:821) at android.hardware.SystemSensorManager$SensorEventQueue.dispatchSensorEvent(SystemSensorManager.java:467)

It seems a known issue on Samsung devices when they owns more 4 vector sensors.

**Platform:4.3
**Mapbox SDK version:5.1.0

Steps to trigger behavior

  1. map.getTrackingSettings().setMyBearingTrackingMode(MyBearingTracking.COMPASS)

Expected behavior

No crash :)

Actual behavior

throw IllegalArgumentException on Samsung device

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Aug 10, 2017
@tobrun tobrun added this to the android-v5.1.3 milestone Aug 10, 2017
@tobrun
Copy link
Member

tobrun commented Aug 10, 2017

Thank you for the report @kfadli, first occurence we heard of it.
Will look into fixing this for next patch release.

cc @cammace, related to LocationLayerPlugin in
https://github.com/mapbox/mapbox-plugins-android/tree/master/plugins/locationlayer

@tobrun
Copy link
Member

tobrun commented Aug 10, 2017

This bug has been reported on Chromium, going to use the same solution:
https://src.chromium.org/viewvc/chrome/trunk/src/content/public/android/java/src/org/chromium/content/browser/DeviceMotionAndOrientation.java?pathrev=246398

@kfadli
Copy link
Author

kfadli commented Aug 10, 2017

Great, thank you for your responsiveness @tobrun

@tobrun
Copy link
Member

tobrun commented Aug 10, 2017

@kfadli do you have this device available for testing?

@kfadli
Copy link
Author

kfadli commented Aug 10, 2017

Unfortunately not, i tried to reproduce with Android Emulator without success.

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

No branches or pull requests

2 participants