react-native-elements / react-native-elements-app

Demo app for React Native Elements (w/ React Native Web)
https://reactnativeelements.com/
1.29k stars 417 forks source link

App fails to start on Apple device #232

Open amitrke opened 3 years ago

amitrke commented 3 years ago

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 commented 2 years ago

@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 commented 2 years ago

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

susaurabh-git commented 2 years ago

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 commented 2 years ago

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

guillem-gelabert commented 2 years ago

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 commented 2 years ago

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