How do I run expo apps on android studio without ejecting? - reactjs

I followed expo documentation, but I can't figure out how to run it on an emulator without ejecting. I've heard ejecting is risky and I can't keep making changes to the app if I eject. When I click run, it gives me Error: Module not specified, but there is no module from the dropdown list.

You can run your app on android emulator with expo app on this emulator or make expo build:android and select apk option. Then just download and install apk on any device. You don't able to run expo app in android studio like native app without ejecting. I recommend you not to use Expo at all and have a look on fast line, pure react native app is more flexible and with fast line has almost the same benefits like expo app. Development without expo is not a big deal.

Related

Is it possible to get rid of expo completely

I'm using react native expo 47 and I wanted to eject from expo to have native modules for ios and android to use my native code or 3rd libraries. But on 47 sdk expo there is no eject. Instead it I could make prebuild which generated for me native folders for ios and android. But when i want to use any library which use native code i have exception that its not defied sdk in gradle etc. How to get rid of expo completely and use react native cli? There is way to migrate from expo to cli without any expo requirements?
I remember that in older expo sdk it was eject prcess which allow you to do whatever you want in project. I want to achieve the same solution.
I want to migrate from expo to react native cli with no expo dependencies and rules, to work with native codes.

React Native unable to compile during npx react-native run android

Hey and good day everyone,
when I want to compile and run my react native code in the android platform, it shows up the error as pictures below (app:processDebugMainManifest FAILED)
The system that I currently use is macOS Monterey v12 with apple M1 chips.
I highly encourage you to Use EXPO project manager instead of using pure react native for development and then if you were curious you can eject from it.
Expo give you lot of power with libraries and expo client.
check it out:
https://expo.dev/

React native EXPO installation (npm start)

I created my app in react native using Expo but when i run the npm start command its showing me this:
running metro bundler on port 8081
and then
loading dependency graph, done
and never end. what to do?
Here is the complete console output.
First of all if you have a bundler like the one that you have used then it would suggest that you have used react-native init to create you application, instead of expo.
Expo bunders look like this:
If you have created a react-native init and as it suggests in your screenshot that you are building the app on a Windows machine, that means you will be developing on Android.
The instructions for using Android and running react-native are quite long and complicated, they can be found here. For the sake of brevity I am not going to repeat them here asyou can just follow this link. Make sure to choose Building Projects with Native Code -> Development OS: Windows -> Target OS: Android to find the instructions that are pertinent to your situation.
https://facebook.github.io/react-native/docs/getting-started.html
If you are planning on developing on an emulator then you will need to make sure that you have one installed (the link above has all the info that you need). Also you need to make sure that you launch your emulator before running react-native run-android if you do that then it should load on to the emulator and you should be able to see what you are developing on.
If you want to run on your own Android device then you should follow the instructions on this page https://facebook.github.io/react-native/docs/running-on-device (again choosing the options for your situation).
Expo
If this feels like too much effort, you can always try Expo. It doesn't require you to be able to deal with native code. And depending on your use case can be a better option than creating a project with react-native init, plus you can always eject from the expo project and turn it in to a full fledged react-native app.
You install the expo-cli with
npm install -g expo-cli
Then download the expo app from the App Store or the Google Play Store (depending on the mobile that you are using).
Then you can use
expo init
to create your application
Check out the expo documentation for more information https://docs.expo.io/versions/v32.0.0/workflow/up-and-running
Well, Nice question, First of all, I totally understand what's exactly your problem is, let me give you a solution in a very appropriate way.
Basically, there is two way to install and setup React Native Project on your mac and windows machines
1st React Native (native) Method: (That's basically you're using right know
Note: If you're using Apple product - Like MacBook then you can do IOS and Android both platform by using this method, if you're using Windows or Linux you can only do this part for Android platforms
In this method, we have to follow these simple steps
Download Nodejs from Offical website link here
Installing the React Native Cli
npm install -g react-native-cli
If you get an error like Cannot find module 'npmlog', try installing npm directly: curl -0 -L https://npmjs.org/install.sh | sudo sh.
(Only for mac)
Install the Xcode from Appstore (Only for Mac user/macos users)
otherwise
download and install the Android Studio (Stable version) from the official website of Android studio
Setup Xcode (Simulator) or Setup Android Studio for Android devices use (emulator)
by learn and guide from this link here
Note: Basically in your scenario, I'm pretty sure you didn't set up your emulator for android and simulator for IOS that's why you didn't see anything after
2nd React Native with Expo Method: that's you're not using a loading dependency graph
Use
For Android
react-native run-android
For IOS
react-native run-ios
2nd React Native without Expo (that's not your case):
In this method, we have to follow these simple steps
Download Nodejs from Offical website link here
installing expo cli
npm install -g expo-cli
expo init yourprojectname
cd yourprojectname
npm start
Note: Simulators and emulators way same for both

Remove expo from react native

I've had so many troubles with the tool, I seriously have been debugging expo morethan the app itself.
How might I remove expo completely from CRNA? I would like to use CRNA and it's debugging tools without expo
You can do it by ejecting your app running npm run eject
Then, if you have any reference to expo just remove all of them.
your app modules before being ejected looks like this below:
When you run npm run eject it will ask some questions like:
be sure to select React Native: I'd like a regular react Native project
And your folders will now look like this (no expo):
Just be careful because ejecting is a permanent process, you should make a backup of your files.
Once you eject from Expo, though, and if you're using a Windows computer, you'll only be able to develop for Android, I believe. You'll still need a Mac to work in React Native without Expo. I'm a beginner but just wanted to highlight this difficulty faced by Windows users when ejecting from Expo.

Detaching from Expo without pain

We are building an Expo / React Native app and we need to detach to add Intercom native library. We really like the workflow we currently have with Expo / Expo client and are a bit frightened to detach.
Let's imagine we are a team of 3 developers:
1 has some native mobile knowledge
1 is a good react/redux developer, mostly managing app state and architecture
1 is a "react native integrator", mostly handling styles and render functions
Is it possible that only the developer with native knowledge manages the ejected app (like, on another git branch?), and that the 2 other developers keep the same productivity that we have with Expo client?
Is it possible to deploy Expo JS updates (not through stores) without having XCode or Android Studio setup locally?
Is there any way to make sure that our "react native integrator" does not have to install XCode / Android Studio / RN just to be able to change some colors and font sizes of the app?
Is it possible to deploy Expo JS updates (not through stores) without having XCode or Android Studio setup locally?
Expo is really cool because even after you detach you can still do exp publish and then your native app will read from that new bundle on Expo.
This is like CodePush but built in! Dev 2, and dev 3 can continue to build an Expo app without ever touching native code. Meanwhile dev 1 can implement native modules for them to use... 😁
Side Note
You may also be prime candidates for Expo release channels, made by the talented Quin Jung!
Here is a quote from the doc: "Consider a situation where you have a Staging stack for testing on Expo Client, and a Production stack for pushing through TestFlight, then promoting to the AppStore..."

Resources