admin管理员组

文章数量:1122832

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."
        }
      ],

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."
        }
      ],
Share Improve this question asked Nov 22, 2024 at 10:19 doobeandoobean 2,1385 gold badges22 silver badges32 bronze badges 1
  • Did you find a solution to this? I'm seeing the same problem. – NorseGaud Commented Nov 24, 2024 at 15:17
Add a comment  | 

1 Answer 1

Reset to default 0

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/

本文标签: google maps api 3Cannot find native module 39ExpoLocation39js engine hermesStack Overflow