react-native-geolocation-service icon indicating copy to clipboard operation
react-native-geolocation-service copied to clipboard

Can not run example app

Open da1z opened this issue 2 years ago • 2 comments

Environment

Run npx react-native info in your terminal and copy the results here.

Platforms

Ios

Versions

Latest

Description

npm run ios or yarn run ios in demo dir result in: error: Error: Unable to resolve module AccessibilityInfo from /react-native-geolocation-service/example/node_modules/react-native-geolocation-service/node_modules/react-native/Libraries/react-native/react-native-implementation.js: AccessibilityInfo could not be found within the project or in these directories: node_modules/react-native-geolocation-service/node_modules/react-native/node_modules node_modules/react-native-geolocation-service/node_modules node_modules ../node_modules

Reproducible Demo

Provide a detailed list of steps that reproduce the issue.

  1. i did yarn install in root and in example
  2. i did pod install

Expected Results

App runs

da1z avatar Jun 29 '22 18:06 da1z

Hi @da1z

I managed to fix this issue, Just add this to your metro.config.js, I will open a PR for this

/**
 * Metro configuration for React Native
 * https://github.com/facebook/react-native
 *
 * @format
 */
const packagePath = '../';

module.exports = {
  resolver: {
    nodeModulesPaths: [packagePath],
  },
  watchFolders: [packagePath],
  transformer: {
    getTransformOptions: async () => ({
      transform: {
        experimentalImportSupport: false,
        inlineRequires: true,
      },
    }),
  },
};

Lavhe avatar Jul 14 '22 17:07 Lavhe

Remove node_modules from both root & example folder. Then only run yarn install inside example folder.

Agontuk avatar Sep 03 '22 06:09 Agontuk