Intl error in Android - Can't find variable: Intl

  1. SDK Version:
    “expo”: “^44.0.0”,
    “expo-asset”: “~8.4.6”,
    “expo-constants”: “~13.0.1”,
    “expo-device”: “~4.1.0”,
    “expo-font”: “~10.0.4”,
    “expo-linking”: “~3.0.0”,
    “expo-splash-screen”: “~0.14.1”,
    “expo-status-bar”: “~1.2.0”,
    “expo-web-browser”: “~10.1.0”,
  2. Platforms(Android/iOS/web/all): Android

While this code works in iOS, it doesn’t work on Android. Here is the code

const abbreviatedNumber = Intl.NumberFormat('en-US', {
        notation: "compact",
    }).format(value);

Here is the error in Android:
**ReferenceError: Can't find variable: Intl**

There might be a solution if I change build configs, but I wonder if there’s any other solution so I can use Expo Go. Also, if you have a better suggestion/replacement, it’d be appreciated.

For Android, you need to change the jsc flavor that the app is built with. Remember, google is a great place to start looking for answers to debugging errors. Intl.numberformat in React native works fine when running in ios but not in android - Stack Overflow

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.