expo localization ERROR: TypeError: undefined is not an object (evaluating '_expoLocalization.Localization.timezone')

i have a react native bare app in which i am trying to use expo-localization and i am getting error:

ERROR TypeError: undefined is not an object (evaluating ‘_expoLocalization.Localization.timezone’)

i have followed the documentation and made sure i have react-native-unimodules also intalled. also i can see unimodules is installed correctly as i can use the constants console.log(Constants.systemFonts) and this works. here is my package json with all the things i have:

    "@react-native-async-storage/async-storage": "^1.13.2",
    "@react-native-community/google-signin": "^5.0.0",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-native-firebase/app": "^10.1.0",
    "@react-native-firebase/auth": "^10.1.0",
    "@react-native-firebase/dynamic-links": "^10.1.0",
    "@react-native-firebase/firestore": "^10.1.0",
    "@react-native-firebase/functions": "^10.1.0",
    "@react-native-firebase/messaging": "^10.1.0",
    "@react-native-firebase/storage": "^10.1.0",
    "@react-navigation/bottom-tabs": "^5.11.2",
    "@react-navigation/native": "^5.8.10",
    "@react-navigation/stack": "^5.12.8",
    "axios": "^0.21.0",
    "expo-localization": "^9.1.0",
    "moment-timezone": "^0.5.32",
    "react": "16.13.1",
    "react-native": "0.63.4",
    "react-native-device-info": "^7.3.1",
    "react-native-fbsdk": "^3.0.0",
    "react-native-gesture-handler": "^1.9.0",
    "react-native-paper": "^4.5.0",
    "react-native-reanimated": "^1.13.2",
    "react-native-safe-area-context": "^3.1.9",
    "react-native-screens": "^2.15.0",
    "react-native-searchable-dropdown": "^1.1.1",
    "react-native-unimodules": "^0.12.0",
    "react-native-vector-icons": "^7.1.0"

make sure you have imported it properly: import * as Localization from 'expo-localization';

docs: Localization - Expo Documentation
example: privileged milkshake - Snack

1 Like

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