0
votes

When I'm trying to run react-native run-android I'm getting this error.

App.js code

import React, {Component} from 'react'; import {Platform, StyleSheet, Text, View} from 'react-native'; import { createStackNavigation } from 'react-navigation'; import Splash from './components/splash/splash'; import Login from './components/login/login';

const App = createStackNavigation({ Login: {screen: Login}, Spash: {screen: Splash} },{ initialRouteName: "Splash", headerMode: "none", });

export default App

Unable to resolve module ./components/splash/splash from /home/subrata/puplr_mobile_app/puplr/App.js: The module ./components/splash/splash could not be found from /home/subrata/puplr_mobile_app/puplr/App.js. Indeed, none of these files exist: * /home/subrata/puplr_mobile_app/puplr/components/splash/splash(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx) * /home/subrata/puplr_mobile_app/puplr/components/splash/splash/index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx) Error: Unable to resolve module ./components/splash/splash from /home/subrata/puplr_mobile_app/puplr/App.js: The module ./components/splash/splash could not be found from /home/subrata/puplr_mobile_app/puplr/App.js. Indeed, none of these files exist: * /home/subrata/puplr_mobile_app/puplr/components/splash/splash(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx) * /home/subrata/puplr_mobile_app/puplr/components/splash/splash/index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx) at ModuleResolver.resolveDependency (/home/subrata/puplr_mobile_app/puplr/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:120:15) at ResolutionRequest.resolveDependency (/home/subrata/puplr_mobile_app/puplr/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:49:18) at DependencyGraph.resolveDependency (/home/subrata/puplr_mobile_app/puplr/node_modules/metro/src/node-haste/DependencyGraph.js:218:16) at Object.resolve (/home/subrata/puplr_mobile_app/puplr/node_modules/metro/src/lib/transformHelpers.js:141:30) at dependencies.map.result (/home/subrata/puplr_mobile_app/puplr/node_modules/metro/src/DeltaBundler/traverseDependencies.js:373:31) at Array.map () at resolveDependencies (/home/subrata/puplr_mobile_app/puplr/node_modules/metro/src/DeltaBundler/traverseDependencies.js:369:18) at /home/subrata/puplr_mobile_app/puplr/node_modules/metro/src/DeltaBundler/traverseDependencies.js:188:33 at Generator.next () at step (/home/subrata/puplr_mobile_app/puplr/node_modules/metro/src/DeltaBundler/traverseDependencies.js:298:30)

1

1 Answers

0
votes

Sometimes you may need to restart the Metro bundler for it to find a newly created file.

If it isn't your issue, you have to make sure that you do have a splash.js file in your /home/subrata/puplr_mobile_app/puplr/components/splash folder.