我已经安装了expo位置:
npx expo install expo-location
每当我尝试在我的应用程序中使用它时都会出现错误
import * as Location from 'expo-location';
console.log(Location) //Leads to an Error when I try to call it
错误:
Android Bundling complete 3254ms
ERROR TypeError: undefined is not an object (evaluating 'nativeModule.__expo_module_name__')
ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
Package.Json 中的依赖项:
"dependencies": {
**"expo": "~47.0.9",**
"expo-file-system": "~15.1.1",
**"expo-location": "~15.0.1",**
"expo-updates": "^0.15.6",
"react": "18.1.0",
"react-native": "0.70.5",
"react-native-maps": "^1.3.2",
}