stackbuilders / react-native-spotlight-tour

A highly customizable tour feature with an awesome spotlight effect
https://stackbuilders.github.io/react-native-spotlight-tour/
MIT License
212 stars 27 forks source link

Crash on Android (Expo 47): "attempt to invoke virtual method 'double java.lang.Double.doubleValue()' on a null object reference" #79

Closed hugoxiong5 closed 1 year ago

hugoxiong5 commented 1 year ago

This happened after I upgraded my app to Expo 47. The library was working on SDK 46.

As soon as I start the tour, the app crashes. It only happens on Android, iOS and web still work. This is the error message I get:

Screenshot_20230105-155559

Here's my package.json:

  "dependencies": {
    "@expo-google-fonts/roboto": "0.2.2",
    "@expo/webpack-config": "0.17.3",
    "@react-native-async-storage/async-storage": "1.17.11",
    "@react-native-firebase/analytics": "14.11.0",
    "@react-native-firebase/app": "14.11.0",
    "@react-native-firebase/crashlytics": "14.11.0",
    "@react-navigation/native": "6.0.11",
    "@react-navigation/native-stack": "6.7.0",
    "@react-navigation/stack": "6.0.11",
    "@stackbuilders/react-native-spotlight-tour": "2.0.0",
    "apisauce": "2.1.5",
    "axios": "1.2.2",
    "bson-objectid": "2.0.3",
    "compression": "1.7.4",
    "dayjs": "1.11.4",
    "expo": "47.0.11",
    "expo-app-loading": "2.1.1",
    "expo-apple-authentication": "5.0.1",
    "expo-auth-session": "3.8.0",
    "expo-av": "13.0.2",
    "expo-dev-client": "2.0.1",
    "expo-device": "5.0.0",
    "expo-font": "11.0.1",
    "expo-notifications": "0.17.0",
    "expo-random": "13.0.0",
    "expo-splash-screen": "0.17.5",
    "expo-status-bar": "1.4.2",
    "expo-updates": "0.15.6",
    "expo-web-browser": "12.0.0",
    "express": "4.18.1",
    "firebase": "9.9.2",
    "lodash": "4.17.21",
    "mobx": "6.7.0",
    "mobx-persist-store": "1.0.6",
    "mobx-react-lite": "3.4.0",
    "native-base": "3.4.22",
    "numeral": "2.0.6",
    "react": "18.1.0",
    "react-apple-login": "1.1.6",
    "react-dom": "18.1.0",
    "react-hook-form": "7.33.1",
    "react-native": "0.70.5",
    "react-native-circular-progress": "1.3.7",
    "react-native-gesture-handler": "2.8.0",
    "react-native-keyboard-aware-scroll-view": "0.9.5",
    "react-native-keychain": "6.2.0",
    "react-native-modal": "13.0.1",
    "react-native-pager-view": "6.0.1",
    "react-native-purchases": "5.0.2",
    "react-native-reanimated": "2.12.0",
    "react-native-safe-area-context": "4.4.1",
    "react-native-screens": "3.18.2",
    "react-native-svg": "13.4.0",
    "react-native-swiper-flatlist": "3.0.17",
    "react-native-tab-view": "3.3.0",
    "react-native-toast-message": "2.1.5",
    "react-native-web": "0.18.10",
    "react-native-web-webview": "1.0.2",
    "react-native-webview": "11.23.1",
    "react-native-youtube-iframe": "2.2.2",
    "react-youtube": "9.0.3",
    "semver": "7.3.7",
    "supermemo": "2.0.17"
  }
JoseLion commented 1 year ago

Thanks for the report @hugoxiong5!

I've seen this before and as far as I can tell this is an issue on react-native-svg with animated SVG components (probably https://github.com/software-mansion/react-native-svg/issues/1857). However, it seems the issue was solved on v13.5.0+. You currently have v13.4.0, can you give it a try updating react-native-svg on your project? Thanks 🙂

hugoxiong5 commented 1 year ago

Thanks for the help! Upgrading to react-native-svg v.13.5.0 solved the issue on Android.

Unfortunately, it also broke the web version of the spotlight tour a little bit, causing the spotlight animation not to display correctly (error message: Error: <circle> attribute transform: Expected transform function, "undefined).

Are you planning to support React Native Web with this library? For me, it's a big use case, so I'm going to stick with Expo SDK 46 for now (react-native-svg 12.3.0), where the tour library does work on all three platforms. Hopefully I can figure out a better way to upgrade later.

JoseLion commented 1 year ago

@hugoxiong5 thanks for the feedback! We haven't thought about support on React Native Web yet, but I think it's worth looking into it. I'll add it to our example and run some tests 🙂

In the meantime, it seems like the error you're getting might be also related to react-native-svg animations, but just in case, we just released v2.1.0, can you give it a try when you got some time? Would love some feedback on this new version too!

hugoxiong5 commented 1 year ago

@JoseLion Thanks, I will definitely try out the new version!

hugoxiong5 commented 1 year ago

@JoseLion Unfortunately, when I tried to update to v2.1.0, the app crashed on React Native Web. (Works nicely on mobile--I like the new upgrades and options.)

Seems to be something causing Webpack compilation to fail:

Screen Shot 2023-03-04 at 9 35 56 AM Screen Shot 2023-03-04 at 9 24 05 AM

Same package.json as the first post in this thread.

JoseLion commented 1 year ago

@hugoxiong5, it seems we might need to add some extra configuration to the package.json to support React Native Web. I'll open a separate ticket so we can tackle everything related to React Native Web support and give the appropriate focus to it. Thanks a lot for all your feedback! It helps us improve the library further 🙂

JoseLion commented 1 year ago

I'm closing this issue in favor of #95, which is specific to React Native Web support.