0

I'm trying to import the expo-location in my react-native app with expo.

I installed the library with this command:

npx expo install expo-location

And importing it:

import * as Location from 'expo-location'

but as soon as I add the import, the app breaks with the following error:

Error: Cannot find native module 'ExpoLocation', js engine: hermes [Component Stack]

My app.json file has

 "plugins": [
      [
        "expo-location",
        {
          "locationAlwaysAndWhenInUsePermission": "Allow this app to use your location."
        }
      ],
2
  • Did you find a solution to this? I'm seeing the same problem. Commented Nov 24, 2024 at 15:17
  • yes, check the answers. you need to build your app again. Commented Jan 15 at 21:21

1 Answer 1

1

you need to rebuild the project

eas build --profile development --platform android

more info here: https://docs.expo.dev/develop/development-builds/create-a-build/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.