Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

App fails to start on Apple device #232

Open
amitrke opened this issue Sep 6, 2021 · 6 comments
Open

App fails to start on Apple device #232

amitrke opened this issue Sep 6, 2021 · 6 comments

Comments

@amitrke
Copy link

amitrke commented Sep 6, 2021

I followed the steps

  1. Cloned repo
  2. Checked the default branch to be next
  3. npm i
  4. npm start

No errors seen so far, when I scan the QR code from my Apple phone, I see an error on the screen and I see the following error in the console

Error: Asset not found: /Users/amit/dev/react-native-elements-app/assets/images/icon.png for platform: null
    at /Users/amit/dev/react-native-elements-app/node_modules/metro/src/Assets.js:188:13
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/Users/amit/dev/react-native-elements-app/node_modules/metro/src/Assets.js:52:24)
    at _next (/Users/amit/dev/react-native-elements-app/node_modules/metro/src/Assets.js:72:9)
iOS Bundling failed 503ms
While trying to resolve module `react-native-elements` from file `/Users/amit/dev/react-native-elements-app/App.tsx`, the package `/Users/amit/dev/react-native-elements-app/node_modules/react-native-elements/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`/Users/amit/dev/react-native-elements-app/node_modules/react-native-elements/dist/index.js`. Indeed, none of these files exist:

  * /Users/amit/dev/react-native-elements-app/node_modules/react-native-elements/dist/index.js(.native|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json)
  * /Users/amit/dev/react-native-elements-app/node_modules/react-native-elements/dist/index.js/index(.native|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json)
@susaurabh-git
Copy link

susaurabh-git commented Sep 21, 2021

@amitrke
Run following command

  1. npm install react-native-elements react-native-elements-universe react-native-ratings --save
  2. npm i
  3. npm start

@amitrke
Copy link
Author

amitrke commented Sep 21, 2021

@susaurabh-git would it be better if I go ahead and add those dependencies to package.json and create a pull request ?

@susaurabh-git
Copy link

These dependencies are already in package.json
"react-native-elements": "https://github.com/react-native-elements/react-native-elements#dist",
"react-native-elements-universe": "https://github.com/react-native-elements/react-native-elements-universe#dist",

@amitrke
Copy link
Author

amitrke commented Sep 22, 2021

If all the dependencies are already part of package.json then why do they not get installed using the command npm i

@guillem-gelabert
Copy link

I have the same problem trying to publish the demo App as this one doesn't work. I tried the steps mentioned by @susaurabh-git and also yarn clean-install. Which outputs the following:

yarn run v1.22.17
$ rm -rf node_modules && npm cache clean --force && watchman watch-del-all && yarn
npm WARN using --force I sure hope you know what you are doing.
{
    "version": "2022.01.17.00",
    "roots": []
}
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
error Couldn't find match for "2078fa39ea3907b024d2d9e39f5205fe3bc6594d" in "refs/heads/2.x,refs/heads/base,refs/heads/circular-slider,refs/heads/dist,refs/heads/dropdown,refs/heads/gh-pages,refs/heads/header-fix,refs/heads/input,refs/heads/master,refs/heads/next,refs/heads/patch,refs/heads/rtl,refs/heads/themed,refs/heads/typescript-work,refs/tags/0.4.5,refs/tags/0.6.0,refs/tags/0.6.1,refs/tags/0.6.2,refs/tags/0.6.3,refs/tags/0.6.4,refs/tags/0.7.0,refs/tags/0.7.1,refs/tags/0.7.2,refs/tags/0.8.1,refs/tags/0.8.2,refs/tags/0.9.0,refs/tags/0.9.4,refs/tags/0.9.5,refs/tags/2.0.2,refs/tags/3.0.0-alpha.1,refs/tags/v0.1.0,refs/tags/v0.10.0,refs/tags/v0.11.0,refs/tags/v0.11.1,refs/tags/v0.11.2,refs/tags/v0.12.0,refs/tags/v0.13.0,refs/tags/v0.14.0,refs/tags/v0.15.0,refs/tags/v0.16.0,refs/tags/v0.17.0,refs/tags/v0.18.0,refs/tags/v0.18.1,refs/tags/v0.18.3,refs/tags/v0.18.4,refs/tags/v0.18.5,refs/tags/v0.19.0,refs/tags/v0.19.1,refs/tags/v0.2.0,refs/tags/v0.2.1,refs/tags/v0.3.0,refs/tags/v0.3.1,refs/tags/v0.3.2,refs/tags/v0.4.0,refs/tags/v0.4.1,refs/tags/v0.4.2,refs/tags/v0.4.3,refs/tags/v0.4.4,refs/tags/v0.4.6,refs/tags/v0.4.7,refs/tags/v0.4.8,refs/tags/v0.5.0,refs/tags/v0.5.1,refs/tags/v0.5.3,refs/tags/v0.5.4,refs/tags/v0.9.7,refs/tags/v1.0.0,refs/tags/v1.0.0-beta,refs/tags/v1.0.0-beta2,refs/tags/v1.0.0-beta3,refs/tags/v1.0.0-beta4,refs/tags/v1.0.0-beta5,refs/tags/v1.0.0-beta6,refs/tags/v1.0.0-beta7,refs/tags/v1.1.0,refs/tags/v1.2.0,refs/tags/v1.2.1,refs/tags/v1.2.2,refs/tags/v1.2.3,refs/tags/v1.2.4,refs/tags/v1.2.5,refs/tags/v1.2.6,refs/tags/v1.2.7,refs/tags/v2.0.0,refs/tags/v2.0.1,refs/tags/v2.0.2,refs/tags/v2.0.3,refs/tags/v2.0.4,refs/tags/v2.1.0,refs/tags/v2.2.0,refs/tags/v2.2.1,refs/tags/v2.3.0,refs/tags/v2.3.1,refs/tags/v2.3.2,refs/tags/v3.0.0,refs/tags/v3.0.1,refs/tags/v3.1.0,refs/tags/v3.2.0,refs/tags/v3.3.0,refs/tags/v3.3.1,refs/tags/v3.3.2,refs/tags/v3.4.0,refs/tags/v3.4.1,refs/tags/v3.4.2,refs/tags/v4.0.0-beta.0" for "https://github.com/react-native-elements/react-native-elements".

@guillem-gelabert
Copy link

Fixed by:

  1. Remove react-native-elements-universe, react-native-elements and react-native from package.json
  2. yarn add react-native-elements-universe react-native-elements react-native from package.json

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants