Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

How to install expo that compatible with RN 0.66.4 #4163

Closed
mangkoran opened this issue Jan 26, 2022 · 7 comments
Closed

How to install expo that compatible with RN 0.66.4 #4163

mangkoran opened this issue Jan 26, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@mangkoran
Copy link

mangkoran commented Jan 26, 2022

Summary

I followed the direction to use expo with RN 0.66.x given in expo/expo#15914 (comment). My project is Android-only. When I'm trying to run npx install-expo-modules, I got the error about iOS deployment target even though my project is Android only.

Environment

❯ expo diagnostics

  Expo CLI 5.0.3 environment info:
    System:
      OS: Linux 5.15 Arch Linux
      Shell: 3.3.1 - /bin/fish
    Binaries:
      Node: 14.18.1 - ~/.local/share/nvm/v14.18.1/bin/node
      Yarn: 1.22.17 - ~/.local/share/nvm/v14.18.1/bin/yarn
      npm: 8.3.2 - /usr/sbin/npm
    SDKs:
      Android SDK:
        API Levels: 29, 30
        Build Tools: 29.0.2, 30.0.2
    npmPackages:
      expo: ^44.0.0 => 44.0.1
      react: 17.0.1 => 17.0.1
      react-dom: 17.0.1 => 17.0.1
      react-native: 0.64.3 => 0.64.3
      react-native-web: 0.17.1 => 0.17.1
    Expo Workflow: bare

Please specify your device/emulator/simulator platform, model and version

WSA v.1.8.32836.0

Error output

This is what I get in my personal project

❯ npx install-expo-modules
✔ Expo modules minimum iOS requirement is 12.0. This tool will change your iOS deployment target to 12.0. Do you want to continue? … yes
› Updating your project...
Uncaught Error [Error: [ios.dangerous]: withIosDangerousBaseMod: ENOENT: no such file or directory, open '/home/mangkoran/repos/crowdfinder-client/ios/Podfile'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/home/mangkoran/repos/crowdfinder-client/ios/Podfile'
}

Reproducible demo or steps to reproduce from a blank project

I am not sure that I can provide reproducible demo like what I encountered in my project. But as my project is Android-only, I think deleting the ios directory is enough.

Steps:

  1. npx react-native init RN066 --version 0.66
  2. cd RN066
  3. rm -rf ios
  4. npx install-expo-modules

Edit: It gave the similar error message as what I encountered in my personal project.

@mangkoran mangkoran added the bug Something isn't working label Jan 26, 2022
@mangkoran mangkoran changed the title Error running npx install-modules Error running npx install-expo-modules Jan 26, 2022
@mangkoran mangkoran changed the title Error running npx install-expo-modules Error running npx install-expo-modules in Android-only project Jan 26, 2022
@mangkoran mangkoran changed the title Error running npx install-expo-modules in Android-only project Error running npx install-expo-modules in Android-only project when trying to upgrade expo with RN 0.66.x compatibility Jan 26, 2022
@Kudo
Copy link
Collaborator

Kudo commented Jan 26, 2022

hi there! install-expo-modules is designed for default react-native project. i'm sorry we doesn't support too much customization there, so removing ios folder is not supported. if the automatic installation doesn't work for you, you can still use the manual installation

@Kudo Kudo closed this as completed Jan 26, 2022
@mangkoran
Copy link
Author

mangkoran commented Jan 26, 2022

Alright then. That's not what I actually want tho. How do I use expo that RN 0.66.4 compatible? Because if I run npm i expo, it will install expo 44.0.5.

@Kudo
Copy link
Collaborator

Kudo commented Jan 26, 2022

expo 44.0.5 should be compatible with react-native 0.66.4. you can try the manual installation with your existing react-native 0.66.4 project.

@mangkoran
Copy link
Author

mangkoran commented Jan 27, 2022

@Kudo I got this error:

Logs for your project will appear below. Press Ctrl+C to exit.
› Opening on Android...
› Opening exp+crowdfinder-client://expo-development-client/?url=http%3A%2F%2F172.19.123.211%3A8081 on Subsystem_for_Android_TM_
› Press ? │ show all commands
Warning: Invalid version react-native@0.66.4 for expo sdkVersion 44.0.0. Use react-native@0.64.3
Warning: Invalid version react-native@0.66.4 for expo sdkVersion 44.0.0. Use react-native@0.64.3
Android Bundling complete 18381ms
Android Bundling complete 50ms
Error: ENOENT: no such file or directory, open '/home/mangkoran/repos/crowdfinder-client/http:/172.19.123.211:8081/index.bundle?platform=android&dev=true&minify=false&app=com.crowdfinder.app&modulesOnly=false&runModule=true'
    at Object.openSync (fs.js:497:3)
    at Object.readFileSync (fs.js:393:35)
    at getCodeFrame (/home/mangkoran/repos/crowdfinder-client/node_modules/metro/src/Server.js:919:18)
    at Server._symbolicate (/home/mangkoran/repos/crowdfinder-client/node_modules/metro/src/Server.js:992:22)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at Server._processRequest (/home/mangkoran/repos/crowdfinder-client/node_modules/metro/src/Server.js:403:7) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/home/mangkoran/repos/crowdfinder-client/http:/172.19.123.211:8081/index.bundle?platform=android&dev=true&minify=false&app=com.crowdfinder.app&modulesOnly=false&runModule=true'
}
Error: ENOENT: no such file or directory, open '/home/mangkoran/repos/crowdfinder-client/http:/172.19.123.211:8081/index.bundle?platform=android&dev=true&minify=false&app=com.crowdfinder.app&modulesOnly=false&runModule=true'
    at Object.openSync (fs.js:497:3)
    at Object.readFileSync (fs.js:393:35)
    at getCodeFrame (/home/mangkoran/repos/crowdfinder-client/node_modules/metro/src/Server.js:919:18)
    at Server._symbolicate (/home/mangkoran/repos/crowdfinder-client/node_modules/metro/src/Server.js:992:22)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at Server._processRequest (/home/mangkoran/repos/crowdfinder-client/node_modules/metro/src/Server.js:403:7) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/home/mangkoran/repos/crowdfinder-client/http:/172.19.123.211:8081/index.bundle?platform=android&dev=true&minify=false&app=com.crowdfinder.app&modulesOnly=false&runModule=true'
}
Error: ENOENT: no such file or directory, open '/home/mangkoran/repos/crowdfinder-client/http:/172.19.123.211:8081/index.bundle?platform=android&dev=true&minify=false&app=com.crowdfinder.app&modulesOnly=false&runModule=true'
    at Object.openSync (fs.js:497:3)
    at Object.readFileSync (fs.js:393:35)
    at getCodeFrame (/home/mangkoran/repos/crowdfinder-client/node_modules/metro/src/Server.js:919:18)
    at Server._symbolicate (/home/mangkoran/repos/crowdfinder-client/node_modules/metro/src/Server.js:992:22)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at Server._processRequest (/home/mangkoran/repos/crowdfinder-client/node_modules/metro/src/Server.js:403:7) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/home/mangkoran/repos/crowdfinder-client/http:/172.19.123.211:8081/index.bundle?platform=android&dev=true&minify=false&app=com.crowdfinder.app&modulesOnly=false&runModule=true'
}
Error: ENOENT: no such file or directory, open '/home/mangkoran/repos/crowdfinder-client/http:/172.19.123.211:8081/index.bundle?platform=android&dev=true&minify=false&app=com.crowdfinder.app&modulesOnly=false&runModule=true'
    at Object.openSync (fs.js:497:3)
    at Object.readFileSync (fs.js:393:35)
    at getCodeFrame (/home/mangkoran/repos/crowdfinder-client/node_modules/metro/src/Server.js:919:18)
    at Server._symbolicate (/home/mangkoran/repos/crowdfinder-client/node_modules/metro/src/Server.js:992:22)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at Server._processRequest (/home/mangkoran/repos/crowdfinder-client/node_modules/metro/src/Server.js:403:7) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/home/mangkoran/repos/crowdfinder-client/http:/172.19.123.211:8081/index.bundle?platform=android&dev=true&minify=false&app=com.crowdfinder.app&modulesOnly=false&runModule=true'
}
Object {
  "Realm": [Function anonymous],
  "RealmNativeModule": null,
}
Object {
  "Realm": [Function anonymous],
  "RealmNativeModule": null,
}
› Reloading apps

npm list expo:

❯ npm list expo
crowdfinder-client@1.0.0 /home/mangkoran/repos/crowdfinder-client
├─┬ expo-dev-client@0.8.0
│ ├─┬ expo-dev-launcher@0.10.0
│ │ └── expo@44.0.5 deduped
│ ├─┬ expo-dev-menu-interface@0.5.0
│ │ └── expo@44.0.5 deduped
│ ├─┬ expo-dev-menu@0.9.0
│ │ └── expo@44.0.5 deduped
│ ├─┬ expo-updates-interface@0.5.0
│ │ └── expo@44.0.5 deduped
│ └── expo@44.0.5 deduped
├─┬ expo-splash-screen@0.14.1
│ └── expo@44.0.5 deduped
└─┬ expo@44.0.5
  ├─┬ expo-application@4.0.1
  │ └── expo@44.0.5 deduped
  ├─┬ expo-constants@13.0.0
  │ └── expo@44.0.5 deduped
  ├─┬ expo-error-recovery@3.0.4
  │ └── expo@44.0.5 deduped
  ├─┬ expo-file-system@13.1.0
  │ └── expo@44.0.5 deduped
  ├─┬ expo-font@10.0.4
  │ └── expo@44.0.5 deduped
  └─┬ expo-keep-awake@10.0.1
    └── expo@44.0.5 deduped

package.json:

...
  "dependencies": {
    "@apollo/client": "^3.5.6",
    "@react-navigation/bottom-tabs": "^6.0.9",
    "@react-navigation/stack": "^6.0.11",
    "core-js": "^3.20.3",
    "expo": "^44.0.5",
    "expo-dev-client": "^0.8.0",
    "expo-splash-screen": "^0.14.1",
    "expo-status-bar": "~1.2.0",
    "graphql": "^16.2.0",
    "graphql-request": "^3.7.0",
    "react": "^17.0.2",
    "react-dom": "17.0.1",
    "react-native": "^0.66.4",
    "react-native-dotenv": "^3.3.1",
    "react-native-gesture-handler": "~2.1.0",
    "react-native-paper": "^4.11.2",
    "react-native-safe-area-context": "3.3.2",
    "react-native-screens": "~3.10.1",
    "react-native-web": "0.17.1",
    "react-query": "^3.34.8",
    "realm": "^10.20.0-beta.0",
    "regenerator-runtime": "^0.13.9"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@commitlint/cli": "^15.0.0",
    "@commitlint/config-conventional": "^15.0.0",
    "@commitlint/cz-commitlint": "^15.0.0",
    "commitizen": "^4.2.4",
    "husky": "^7.0.4"
  },
...

@mangkoran mangkoran changed the title Error running npx install-expo-modules in Android-only project when trying to upgrade expo with RN 0.66.x compatibility How to install expo that compatible with RN 0.66.4 Jan 27, 2022
@Kudo
Copy link
Collaborator

Kudo commented Jan 28, 2022

if you could provide a git repo to minimal reproducible example, that would be helpful for troubleshooting.

i tried the following steps for react-native 0.66 and it works for me.

$ npx react-native init RN066 --version 0.66
$ npx install-expo-modules
$ expo install expo-dev-client

# manually patch node_modules/expo-dev-launcher/android/build.gradle to add this: https://github.com/expo/expo/blob/d2174859d64a146f410ddfc24fddb30048092ea8/packages/expo-dev-launcher/android/build.gradle#L163-L188

$ expo run:android

@mangkoran
Copy link
Author

mangkoran commented Jan 29, 2022

You are using npx install-expo-modules. Like I said before, I cannot use npx install-expo-modules. Have you tried installing manually using npm i expo?

Update: I forgot to run expo run:android after updating react-native etc. Now I got errors that I think it is related to expo/expo#15632

Update: Also got error that related to expo/expo#16017

@mangkoran
Copy link
Author

mangkoran commented Jan 29, 2022

Hmm after looking at npm list expo-file-system, the version that expo 44.0.5 depends on is still expo-file-system@13.1.0. I think its best to bump the dependencies too.

How do I manually update all the expo modules?

Update: Nvm, I updated it using npm-check

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants