Best and easy way to Build React Native APP for both Android and iOS. We need an installation file to publish our mobile application. Therefore you require an installation file for mobile.
In this tutorial we discuss about build process of react native app. And also discuss some common problem occur at the time of build installation file.
Table of Content
- Install Expo CLI
- Configuration of App.json file for React native app build
- Change icon and splash images for app
- Build process of the React native app
- How to solve the Errors
First of all, you need to create a native application before building it for android and ios. I hope you have created your app and ready to publish. If you want to know how to create an app in react native then please go through the following link.
Create your react native app for Android & iOS
Click on above link to know simplest way to create react native app.
Convert your website into a mobile app
Click on above link to know how convert your website into a mobile app.
React native build app .apk for android or .ipa file for ios
Now we discuss the essential steps that need for building .apk (Android) and .ipa (iOS) file.
Step 1: Install Expo CLI
We use the expo CLI tool for developing and building the app. Therefore we need to install Expo CLI. For installation Expo CLI run following command in terminal.
npm install -g expo-cli
OR
yarn global add expo-cli
If you use expo first time then you need to create an expo account and login with the expo account. You will get automatically this account creation form when need. Just fill up with a valid email id.
If you are a windows user then you must enable WSL. You can read installation guideline of WSL
Step 2: Configuration of App.json file for React native app build
In this step you need to create two configuration settings. One is for android and another is for iOS. Update the App.json file with as following.
{
"expo": {
"name": "APP Name",
"slug": "app-name",
"privacy": "public",
"sdkVersion": "36.0.0",
"platforms": [
"ios",
"android",
"web"
],
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"bundleIdentifier": "com.companyname.appname",
"buildNumber": "1.0.0"
},
"android": {
"package": "com.companyname.appname",
"versionCode": 1
}
}
}
Hare you just need to change your app name and slug and add two additional sections.
For Android
"android": {
"package": "com.companyname.appname",
"versionCode": 1
}
For iOS
"ios": {
"bundleIdentifier": "com.companyname.appname",
"buildNumber": "1.0.0"
}
Do not forget to change your unique identifier. For android change the value of “package” and for iOS change the value of “bundleIdentifier”. It’s necessary before start building app.
Step 3: Change icon and splash images before start building React native app
Change app icon which is available under the assets directory. Also change splash image before start the build process. Keep the splash and icon exactly the same aspect ratio and height width. Best way to open those files with Photoshop or other image editor software and change it with your images.
Step 4: Start the build process of the React native app.
Run build command for creating .apk file for android and .ipa file for ios. Run the following command.
For android
expo build:android
For ios
expo build:ios
If you want to build for Android
In the case of android build you can choose two types of build processes. One is for build “APK” and another is Android App Bundle. Below describe commands for both.
For build “APK”
expo build:android -t apk
For app bundle
expo build:android -t app-bundle
App bundle is always recommended but one important checking you need to do that is Google Play App Signing enabled in your project. Run the expo command in command prompt.
Build Errors and solutions
ERROR! “expo” is not recognized
You may get this error while run expo command for build purpose.
‘expo’ is not recognized as an internal or external command, operable program or batch file.
If you get this type of error then check the “%USERPROFILE%\AppData\Roaming\npm” location. just copy the location and open folder and find the “EXE” file. the “EXE” file name may be “exp” instead of “expo” and also check the environment variable path. If the path does not exist then you should set the path.
Is case of the “EXE” file name is “exp” the please go with following command.
For Android apk file
exp build:android
For ios .ipa file
exp build:ios
Error: Problem validating fields in app.json
[21:13:07] Error: Problem validating fields in app.json. See https://docs.expo.io/versions/v36.0.0/guides/configuration.html
[21:13:07] • Field: ios.bundleIdentifier – ‘ios.bundleIdentifier’ should be a iOS bundle identifier notation unique name for your app. For example, host.exp.expo, where exp.host is our domain and expo is our app name..
[21:13:09] Error: Problem validating fields in app.json. See https://docs.expo.io/versions/v36.0.0/guides/configuration.html
[21:13:09] • Field: ios.bundleIdentifier – ‘ios.bundleIdentifier’ should be a iOS bundle identifier notation unique name for your app. For example, host.exp.expo, where exp.host is our domain and expo is our app name..
This type of error we get due to invalid app identifier settings. Just check the following section in your app.json file.
"ios": {
"bundleIdentifier": "com.companyname.myappname",
"buildNumber": "1.0.0"
},
"android": {
"package": "com.companyname.myappname",
"versionCode": 1
}
You need to set “bundleIdentifier” for ios and “package” for android.
ERROR! connect ECONNREFUSED 127.0.0.1:19001
connect ECONNREFUSED 127.0.0.1:19001
Error: connect ECONNREFUSED 127.0.0.1:19001
at TCPConnectWrap.afterConnect as oncomplete
This error occurs due to the React Native app not running. To avoid this type of error you need to start the app first and at the same time open another window to run build command like the below image.
ERROR! write ECONNRESET
write ECONNRESET
Error: write ECONNRESET
at WriteWrap.onWriteComplete as oncomplete
This type of error may generate for following issues.
- For networking issue – please check you internet connection
- Check your firewall – If possible disable your firewall for some time.
- Your antivirus may block it – If possible disable antivirus for some time.
After that run the build command again. Now I hope you will successfully complete your build process.
When the build process is in progress then you will get an URL. using this URL you can get build status from time to time like below.
I like this post, enjoyed this one thankyou for posting.
But wanna input on few general things, The website design is perfect, the articles is very superb. “The stars are constantly shining, but often we do not see them until the dark hours.” by Earl Riney.
I have been surfing online more than 3 hours today, yet I never found any interesting article like yours. It?s pretty worth enough for me. In my opinion, if all site owners and bloggers made good content as you did, the net will be much more useful than ever before.
Thanks for the suggestions about credit repair on your blog. The thing I would offer as advice to people is usually to give up this mentality that they may buy at this moment and shell out later. Being a society many of us tend to try this for many factors. This includes vacations, furniture, in addition to items we really want to have. However, you should separate your current wants from all the needs. As long as you’re working to raise your credit ranking score you really have to make some sacrifices. For example you possibly can shop online to economize or you can visit second hand retailers instead of highly-priced department stores regarding clothing.
Thanks for the new things you have uncovered in your post. One thing I’d like to touch upon is that FSBO connections are built over time. By presenting yourself to the owners the first saturday their FSBO is announced, ahead of masses commence calling on Wednesday, you build a good link. By mailing them instruments, educational materials, free reports, and forms, you become a great ally. By subtracting a personal interest in them and their circumstance, you produce a solid interconnection that, most of the time, pays off if the owners opt with a real estate agent they know and trust – preferably you actually.
Through my observation, shopping for electronics online may be easily expensive, but there are some tricks and tips that you can use to acquire the best offers. There are often ways to discover discount offers that could make one to hold the best gadgets products at the smallest prices. Great blog post.
I do not even know how I ended up here, but I thought this post was great. I do not know who you are but certainly you’re going to a famous blogger if you are not already 😉 Cheers!
I am typically to blogging and i really recognize your content. The article has really peaks my interest. I am going to bookmark your web site and maintain checking for brand spanking new information.
Sweet web site, super style and design, rattling clean and use genial.
When I initially commented I clicked the -Notify me when new feedback are added- checkbox and now each time a comment is added I get four emails with the identical comment. Is there any manner you may remove me from that service? Thanks!
I have realized that over the course of developing a relationship with real estate owners, you’ll be able to get them to understand that, in every real estate transaction, a commission rate is paid. Eventually, FSBO sellers do not “save” the commission. Rather, they struggle to earn the commission by doing a agent’s work. In this, they invest their money as well as time to carry out, as best they are able to, the obligations of an representative. Those responsibilities include uncovering the home by way of marketing, showing the home to buyers, creating a sense of buyer emergency in order to induce an offer, organizing home inspections, dealing with qualification inspections with the bank, supervising maintenance tasks, and facilitating the closing.
Hello There. I discovered your blog the usage of msn. This is a really smartly written article. I will be sure to bookmark it and return to learn extra of your useful information. Thank you for the post. I?ll certainly comeback.
You really make it appear so easy along with your presentation however I find this matter to be really something that I feel I would by no means understand. It seems too complex and very broad for me. I am taking a look forward in your next publish, I will try to get the grasp of it!
You’ve been really helpful to me. Thank you!
A person necessarily lend a hand to make critically articles I would state. That is the very first time I frequented your web page and thus far? I amazed with the analysis you made to make this actual submit amazing. Fantastic process!
Valuable information. Lucky me I found your site by accident, and I am shocked why this accident didn’t happened earlier! I bookmarked it.
May I request that you elaborate on that? Your posts have been extremely helpful to me. Thank you!
Please answer my question. How can i contact you regards this article?
Your articles are very helpful to me. May I request more information?
You’ve been really helpful to me. Thank you!
What’s Happening i am new to this, I stumbled upon this I’ve found It absolutely helpful and it has helped me out loads. I hope to contribute & assist other users like its aided me. Great job.
Hmm it looks like your site ate my first comment (it was extremely long) so I guess I’ll just sum it up what I submitted and say, I’m thoroughly enjoying your blog. I as well am an aspiring blog blogger but I’m still new to the whole thing. Do you have any points for newbie blog writers? I’d genuinely appreciate it.
I believe other website owners should take this site as an example , very clean and excellent user genial style.
You should take part in a contest for one of the best blogs on the web. I will recommend this site!
Hey there! Quick question that’s totally off topic. Do you know how to make your site mobile friendly? My weblog looks weird when browsing from my iphone 4. I’m trying to find a template or plugin that might be able to fix this problem. If you have any suggestions, please share. Cheers!
If you desire to increase your experience only keep visiting this site and be updated with the most up-to-date news posted here.
Hi there, its fastidious paragraph regarding media print, we all understand media is a great source of facts.
I’ve recently started a blog, the information you provide on this site has helped me tremendously. Thanks for all of your time & work. “It is a great thing to know our vices.” by Cicero.
Here are some links to sites that we link to for the reason that we assume they may be worth visiting. Seka Christian Ama
662422 50506articulo agregado a favoritos, lo imprimir cuando llegue a la oficina. 989241
691812 138365This internet internet site could be a walk-through its the data you wanted in regards to this and didnt know who need to. Glimpse here, and youll absolutely discover it. 184126
Wow, cool post. Id like to write like this too – taking time and real effort to make a great article but I procrastinate too significantly and never appear to get started. Thanks though.
387168 947833I appreciate your function , thanks for all of the informative blog posts. 429534
914247 32812Most reliable human being messages, nicely toasts. are already provided gradually during the entire wedding celebration and therefore are anticipated to be very laid back, humorous and as effectively as new all at once. greatest man speech 920633
932165 254558Hi. Thank you for creating this website . I m working on betting online niche and have discovered this site using search on bing . Will likely be positive to appear a lot more of your content . Gracias , see ya. :S 813484
111152 812278hello!,I like your writing so a lot! share we communicate extra approximately your post on AOL? I require an expert in this space to solve my issue. Perhaps that is you! Searching ahead to see you. 367692
Wow! This blog looks just like my old one! It’s on a entirely different
topic but it has pretty much the same layout and design.
Outstanding choice of colors!
Check out my web site: Royal CBD
Like!! I blog quite often and I genuinely thank you for your information. The article has truly peaked my interest.
Hi there just wanted to give you a quick heads up and let you know a few of the pictures
aren’t loading properly. I’m not sure why but I think its a
linking issue. I’ve tried it in two different internet browsers and both show the same
outcome.
Thanks, I’ll check it.