capitalone / react-native-pathjs-charts

Android and iOS charts based on react-native-svg and paths-js
Apache License 2.0
879 stars 261 forks source link

Compilation error with RN 0.44 (incorrect arguments to TouchEvent.obtain) #147

Closed piemonkey closed 7 years ago

piemonkey commented 7 years ago

With RN 0.44.0 the TouchEvent.obtain method signature has been changed to add a new argument, which causes compilation of the version of react-native-svg used. This has been fixed in the latest version (5.1.8).

This is easy to reproduce by generating a brand new RN project with react-native init, installing react-native-pathjs-charts and attempting to compile for Android.

A temporary but dirty workaround is to modify node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/RNSVGSvgView.java to add the following (TouchEvent.obtain is on line 125):

            TouchEvent.obtain(
                mTargetTag,
                type,
                ev,
+               ev.getEventTime(),
                ev.getX(),
                ev.getY(),
                mTouchEventCoalescingKeyHelper));

Alternatively you could pull the logic for setting mGestureStartTime from the 5.1.8 version of the SvgView.java` file.

marzolfb commented 7 years ago

Thanks @piemonkey - this is very timely.

I have finally figured out how to work around text rotation behavior changes in react-native-svg that kept me from upgrading to the latest version of that library. This has been problematic for many of the issues logged here for a long time.

So, I will work on upgrading to the latest version of react, react-native and react-native-svg dependencies and incorporating your info here.

marzolfb commented 7 years ago

Should be fixed now with the update to the latest version of the major dependencies in #149.