Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IllegalArgumentException on Samsung devices #17

Closed
darwind opened this issue Aug 25, 2015 · 1 comment
Closed

IllegalArgumentException on Samsung devices #17

darwind opened this issue Aug 25, 2015 · 1 comment

Comments

@darwind
Copy link

darwind commented Aug 25, 2015

After upgrading to version 1.1.0 we're getting below error.

From what we can see it's only an issue on Samsung devices running Android 4.3 and especially on Samsung S4 and Samsung Note 3.

We can't reproduce it ourselves because of missing test devices, but the above is what Crashlytics tells us in the logs.

I've found this thread about SensorManager.getRotationMatrixFromVector throwing this IllegalArgumentException: https://groups.google.com/forum/#!topic/android-developers/U3N9eL5BcJk

This "quick-fix"/workaround is adding a try-catch to the part of the code, where SensorManager.getRotationMatrixFromVector is called and then change the length of array to 3, if this exception is thrown.

java.lang.IllegalArgumentException: R array length must be 3 or 4
at android.hardware.SensorManager.getRotationMatrixFromVector(SensorManager.java:1336)
at com.nvanbenschoten.motion.SensorInterpreter.setTargetVector(SensorInterpreter.java:134)
at com.nvanbenschoten.motion.SensorInterpreter.interpretSensorEvent(SensorInterpreter.java:74)
at com.nvanbenschoten.motion.ParallaxImageView.onSensorChanged(ParallaxImageView.java:119)
at android.hardware.SystemSensorManager$SensorEventQueue.dispatchSensorEvent(SystemSensorManager.java:463)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:132)
at android.os.Looper.loop(Looper.java:124)
at android.app.ActivityThread.main(ActivityThread.java:5414)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
at dalvik.system.NativeStart.main(NativeStart.java)

@nvanbenschoten
Copy link
Owner

Closing as a duplicate of #16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants