Skip to content

Instantly share code, notes, and snippets.

@phuochau
Last active November 5, 2023 11:48
Show Gist options
  • Save phuochau/aeba7740c47fd4ed49c8b01698875fb0 to your computer and use it in GitHub Desktop.
Save phuochau/aeba7740c47fd4ed49c8b01698875fb0 to your computer and use it in GitHub Desktop.
Step to Step to eject Expo by right way (Expo 32.0.0)

1. Step to step to eject to ExpoKit by right way:

Step 1. Run command: expo eject in root of expo project.

Step 2. Choose 2nd option: Eject to ExpoKit and follow step to step from Expo command to eject it completely.

Step 3 (Optional) Install dependencies (normally, Expo will auto run this command)

yarn install

Step 4. Install CocoaPods dependencies. If you don't have CocoaPods, you can follow guideline at https://cocoapods.org/ to install

cd ios && pod install

Step 5. Enable background modes for iOS project. It requires for Expo.

- Open Xcode project.
- Go to "Capabilities"
- enable BackgroundMode.
- Checked into "Background fetch" && "Remote notifications"

Step 6. Checking the configuration by running the project

You can run the project by below command (please note that we need do step to step)

- Run `yarn start` to run Expo DevTools and waiting for Tunnel Ready.
- Open Xcode by clicking into `ios/<ProjectName>.xcworkspace` to run iOS app manually because we can't run it by command from now.

IMPORTANT NOTES: ExpoKit 32.x.x is not stable with Xcode 10.2. Sometimes we can get EXC_BAD_ACCESS and crashing. It's not related to react-native-captuvo because I was run with basic ExpoKit project. So just be patient, and close Expo, close Simulator and run again, sometimes it works. Not sure what is the issue right now.

2. Step to step to eject to a plan React Native project by right way:

Step 1. Run command: expo eject in root of expo project.

Step 2. Choose 1st option: Eject to a plain React Native and follow step to step from Expo command to eject it completely.

Step 3 (Optional) Install dependencies (normally, Expo will auto run this command)

yarn install

Step 4. Install babel packages

yarn add @babel/core @babel/runtime --dev

Step 5. Create index.js at root of project with below content:

/**
 * @format
 */

import {AppRegistry} from 'react-native';
import App from './App'; // main app file of Expo
import {name as appName} from './app.json';

AppRegistry.registerComponent(appName, () => App);

Step 6. Download all third-party libraries of React Native by running below commands:

cd node_modules/react-native/scripts && ./ios-install-third-party.sh && cd ../../../

Step 7. Install third-party/glog by below command:

cd node_modules/react-native/third-party/glog-0.3.5/ && ../../scripts/ios-configure-glog.sh && cd ../../../../

Step 8. Checking the configuration by running the project. You can open Xcode and click Run.

@dyrkow
Copy link

dyrkow commented Aug 3, 2020

Step 7 for expo 35.0.0

- cd node_modules/react-native/third-party/glog-0.3.5/ && ../../scripts/ios-configure-glog.sh && cd ../../../../
+ cd node_modules/react-native/scripts/third-party/glog-0.3.5/ && ./configure && cd ../../../../../

@shakyarahul
Copy link

react-native-community/netinfo also have to be installed ExpoKit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment