I have removed both android and iOS folders after I detached, is there any way that I can bring back both android and iOS folders?
My app is detached from expo, is there a way that I can regenerate those two folders without having to upgrade the app.
I would recommend you to start with a new project without expo and copy all components (react-native init AwesomeProject).
After I detached my project from expo I still had a lot of problems caused by expo. Especially the gradle config in android was a mess because of different versions (react-native-svg for example, which is standard in expo, but outdated).
And after starting new the project size decreased around 12MB...
Starting new took me around 2 hours, messing around with expo days...
Did you use some dependencies from expo in your project?
Related
I have an React Native application that was created without using Expo. So, I have to manually manage a bunch of stuff. Not my choice.
I noticed that the package.json has a version field. However, as far as I understand, if I want to deploy my app to the app stores, I have to set the new versions in Android Studio and Xcode.
So, what's the point of the version number in package.json? Is it just like leaving yourself a note? Does it matter if you even use it?
I have installed a react-native app built with expo cli from playstore, I am migrating to react-native cli. I am not able to install the react-native cli build(signed with the same android key) over the existing expo build. I am getting the following error
App not installed, the package conflicts with an existing package by
same name
any solution will be greatly appreciated
Expo and React-native cli are two different things , as i am too implementing both in single app , after that my app start crashing so you can only use one cli at a moment .
here are the difference and merits -demerits of both .
React Native init:
Merits:
You can add native modules written in Java/Objective-C (probably the only but the strongest one)
Demerits:
Needs Android Studio and X Code to run the projects
You can't develop for iOS without having a mac
Device has to be connected via USB to use it for testing
Fonts need to be imported manually in X Code
If you want to share the app you need to send the whole .apk / .ipa file
Does not provide JS APIs out of the box, e.g. Push-Notifications, Asset Manager, they need to be manually installed and linked with npm for example
Setting up a working project properly (including device configuration) is rather complicated and can take time
Expo:
Merits:
Setting up a project is easy and can be done in minutes
You (and other people) can open the project while you're working on it
Sharing the app is easy (via QR-code or link), you don't have to send the whole .apk or .IPA file
No build necessary to run the app
Integrates some basic libraries in a standard project (Push Notifications, Asset Manager,...)
You can eject it to Expo Kit and integrate native code continuing using some of the Expo features, but not all of them
Expo can build .apk and .ipa files (distribution to stores possible with Expo)
Demerits:
You can't add native modules (probably a game changer for some)
You can't use libraries that use native code in Objective-C/Java
The standard Hello World app is about 25MB big (because of the integrated libraries)
If you want to use: Face Detector, Ar Kit o Payments you need to eject it to Expo Kit
Ejecting it to Expo Kit has a trade-off of features of Expo, e.g. you cannot share via QR code
When ejecting to Expo Kit you are limited to the react native version that is supported by Expo Kit at that point in time
Debugging in Expo Kit (with native modules) is a lot more complicated, since it mixes two languages and different libraries (no official Expo support anymore)
And you can use any one which satisfies your applications requirement.
Hope it will make you understand the difference between these two Clis.
My Expo-based React Native App works without a problem when run in the Expo tool but gave the following errors when built as an APK to be installed and run standalone.
A series of white screens keep flipping before the blue screen comes up.
Here are my App.JSON and Package.JSON files
Package.json
App.json
And here are the screen capturing the error message.
Actually there are two ways to create a React Native application
create-react-native-app (CRNA)
react-native init
As you stated in comment section, You created your project using CRNA
CRNA will gave you some form of solid project structure, which is really useful for beginners to get started with react native, you code the app with pure javascript and the app will work inside Expo.
Now if you want to take build and run as a standalone apk for android,
There are two methods
You can run command: exp publish:android
You can eject your app from expo
Dont use exp publish for standalone apks,
You can use second method:
To eject your app:
First if you dont use any expo apis inside your apps, it is very easy to eject and build as a stand alone apk.
just do yarn eject
This will gave you some instructions and follow that.
After that your CRNA project structure will be converted into react-native init project structure, now you will be able to see "Android" and "iOS" folders inside your application
To take build Run: connect your phone with USB debugging ON and react-native run android.
That's all.
Solved my own problem. The 'eth-lightwallet' library works perfectly within the Expo development tool but when I build into an APK, it just made the white screen turns up with no meaningful error messages.
The solution is to replace it with a pure web3js implementation.
This may be useful if you are developing a mobile app for Ethereum.
I am using React Native for the first time and I can see that we can detach from the Expo. I have no reason to detach, but I am sure will have later so I will detach from the start.
Question: What is the commands to start directly detached app using react native commands.
I have used create-react-native-app my-app then run expo detach this seemed to detach the app but for some reason only android folder is showing while ios folder is missing, anyone have any idea how do I have both platforms created on a detached version!
Thanks
A Mac is required to build projects with native code for iOS. You can follow the Quick Start to learn how to build your app using Create React Native App instead.
As per the react-native docs, you can't detach & develop for iOS unless you are on a Mac. Link(Under Building Projects with Native Code)
I literally started reading about ReactNative an hour ago and am reading this git readme https://github.com/react-community/create-react-native-app/blob/master/react-native-scripts/template/README.md
Next I googled about it and found this link which seem to be explaining it but not to me novice in web, react, or react-native
https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md
Can someone explain to me as if I am 2 years old what is the meaning of eject? I keep hearing term "ejected project" but I cannot wrap my head around it.
Summary
If you created an app using create-react-native-app MyApp, ejecting your app gets your app to be the same as if you created your project using react-native init MyApp
aka
create-react-native-app MyApp > make changes to app > eject app
is roughly equivalent to
react-native init MyApp > make changes to app
More Details
What's the difference between create-react-native-app MyApp and react-native init MyApp?
Quick start vs. Full scale development
The philosophy behind create-react-native-app is:
Minimal "Time to Hello World": Create React Native App should reduce the setup time it takes to try building a mobile app to the absolute minimum, ideally on par with React web development (especially as seen with Create React App).
Develop on Your Device: It should be easy to develop on a physical device when you want to test how your app feels and responds to inputs.
One Build Tool: If you just want to get started with React Native, you shouldn't need to install Xcode, Android Studio, NDKs, or mess with environment variables.
No Lock-In: You can always "eject" to your own build setup if you need to write custom native code or modify how your app is built.
Essentially, create-react-native-app lets you get up and running quickly without having to a do a lot of (or any) configuration. In order to do this, it hides a lot of details from you.
If you want to create a serious app, you need to set up a real development environment. You can do this from scratch by running react-native init <project-name>. If you started with a react native project using create-react-native-app, you can get to this same place by "ejecting" your app
More details from the official documentation about getting started with React Native can be found here.
My understanding is that when you run the "create-react-native-app" (or "expo init" now) you are basically adding the Expo library on top of React Native.
I think the main reason for using Expo is to get your app up and running quickly. I think the main reason to eject is that eventually you might need to do more complicated customization with native code and need more control, etc. Here is a better explanation of Expo vs React Native CLI to bootstrap your app:
https://levelup.gitconnected.com/expo-vs-react-native-cli-a-guide-to-bootstrapping-new-react-native-apps-6f0fcafee58f
When you eject you are returning to the same state as if you did not use Expo to setup your app (native ios/android projects will be generated, etc.)
Here are a few other links that helped me understand:
http://www.reactnativeexpress.com/environment
https://docs.expo.io/versions/latest/expokit/eject/