Creating APK for Android in React Native with Expo EAS Build [Updated 2023]

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello this is for gone from Lahore Graphics Academy and in this tutorial we are going to learn how to create APK for Android in react native Expo with EAS build now previously it was Expo built that we used and this year's update after this year's update we need to use the EAS build in order to create the APK it's quite confusing if you are doing it for the first time but once you do it for the first time after that it's very easy so I'm not why is it needed to have an APK because not all the time you need your mobile app to be published on play store or iStore you need a file or app to be tested on your local device before you publish it on the Play store so you need the APK file and let's start the process of installing of getting the ab here you can see a Blog that I've written and I'll share the link in the description you can follow this along so that you can copy and paste the code that is about to be shown Step One is install the Expo CLI and it's very easy I just run this command and it will install the Expo CLI if you have installed or you do not know whether it's installed or not you can use this command export-b it will show you the version of the Expo install of the Expo CLI installed and that's it that's the first step install the Xbox CLI second step is to create a react native project I assume that you already have a project so I'm not going to go through this step here you already all have a project and we want to go and get the APK file so create a normal native project or use the one that you already have this step is essential step number three you do not have an EAS dot Json file if you are starting it for the first time now if I switch to my um file there will be no this is the normal root directory of the project and you can see that this file EAS purchase and is here but in your case if it's the first time it will not be here this file doesn't exist in natural and normal react native project you have to create one EAS dot Json create this file and copy this entire as it is into this file so first step is to create this file second step is to copy and paste this code you can copy it from this I have um written it here easy copy and paste and one more thing I want to add is that by default why do we need to create this file by default Expo creates a build for the Android play store so we need to mention it with this build type APK that we are not looking for the production at the moment we want an APK file that we can install in our local device so we are mentioning it here all the statement um build type APK Gradle command and development client all these indicates that we are not using we don't want the production file which is aab we want APK file okay so this is what this file does it tells basically this statement tells that we are going for the APK file and not the aab file not the aab file which is a production file bundle so this is the directory this file you need to create after creating it copy and paste this entire code there that's it that is your step number three now we need to create the APK for Android okay it's basically what you want this command line make sure your server is stopped after the if your server is stopped in the terminal like over here terminal new terminal and you will uh for make sure that it is pointing at the project that has the react native code and after that you can use EAS build Android and preview is over here this is where it's coming from you can name it whatever you want as per your project Okay so copy this and run it in your terminal it will start creating or it will put your app into queue in your Expo make sure over here I said um you must be logging in your Expo account on browser as well as in the Expo command terminal if you are not it will either it will either make sure that you create one if you run it over here it will either create one or if you have your username or password you just have to enter it um that step is obviously in my case it's done so I'm not going to do that what I can do is I'm going to run this command copy after I copy this I will go to the terminal paste it here and press enter this is the last step basically after this my file will be created and you can see that um something about version error that's being that we can ignore that for now because I know what I'm doing you can see this is saying use this mode only if you know what you are doing and I basically know what I'm doing so it's okay using remote Android credentials as you can see that I have already been I'm already logged in so it's using those credentials keystroke from configuration okay it will fetch it you know compressing project uploading it it's done uploaded in 10 seconds build details are over here and that's it my build has been queued and once it is queued in the export dashboard which I can open um here okay some error which I can open here um Expo build and you can see that it is building after this is built you can click on it and basically it will be showing you um the process step by step if there are any errors you can leave it in the comment I will be happy to help you out and all things are over here it's profile the profile is view preview version is one version code is one everything is as per the file it's getting it from the file after Json and that's it after it's done no need to worry about this errors it will be removed because now it's reading it you can don't worry if if the errors are here uh red lines they will be removed automatically you can see it I'm not pausing or stopping the video it is running you can see this icon it's running at the moment it will take time for each and every step and after each and every step it will resolve these errors by itself until and unless it says specifically that it's not done okay it's done um added the files and once this is green ticket means it's done there is no errors that needs attention so all the steps are being good there are no errors run expert doctor this is something that catches a lot of Errors so let's see in my case if it's if it's um getting any errors okay it's getting error in uh okay it's not getting error sorry run Expo doctor okay I have used this um react native say feature content 4.5.0 my version is using 4.5.2 I can show you that in the file you can see it in the app.json let's minimize it sorry uh package or package.json react native safe area 4.5.2 this is the version that I am using and this is a version that he says you should use because of some um compatibility or dependencies issues and that is something that needs to be focused so I can install it right away I can install the react native 4.5.0 safe area content but I am sure hundred percent that it will not be a factor in in the app being crashed but yes in later development I might need to update the dependencies that's causing this error but for now I'm going to leave it as it is it's an error a warning but not an error you can see it warning icon the rest is uh pretty simple once you've cleared the Run export doctor or all these steps you just need to wait and it will be presented to you over here this notify me button will convert into download that is the APK button and after that you will be able to download it in your app and mobile and and run it hope this helps all you need to do is um go back to this all you need to do is follow this tutorial and you'll be good to go this is the button that I was saying download button over here so go through this article it's very well um written in terms of that all the steps are here you just need to copy and paste and you're good to go and if you're here just might want to click on some ads so I can get some money okay thank you bye
Info
Channel: Lahore Graphics Academy
Views: 11,284
Rating: undefined out of 5
Keywords: Programming, Coding, Beginner coder, React Native, React, Javascript, expo, Mobile Dev, Android, full stack, apk, build, expo cli, build apk in react native, creating apk from expo react native, react native apk, expo apk, manual apk installation, creating apk for android
Id: EBFodDiGLN8
Channel Id: undefined
Length: 10min 15sec (615 seconds)
Published: Fri May 12 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.