Open In App

How to Convert an Expo App to Apk in React Native for Android

Last Updated : 03 Apr, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

React Native is a cross-platform application that is used to build Android as well as IOS applications. It uses JavaScript as the standalone language for development. It is a JavaScript framework based on React, an open-source library that makes React native easy to learn. In this article, we will see how to convert an expo app to Apk in React-Native. Expo is used to run your React Native applications.

Steps to Convert an Expo App to Apk in React Native for Android:

Step 1: Installing EAS CLI

Go to your project directory open your terminal and run the below command.

npm install -g eas-cli

Expo Application Services (EAS):

EAS will help you to create a binary or final APK of your app that is ready to be submitted to the Google Play Store or Apple App Store.

Step 2: Expo account Login

If you are already logged in, then you can skip the step and run the Step 4 command. Else run the following command.

eas login

Run command eas whoami to check you are logged in or not.

Step 3: Create a build

eas build --platform android
  • This command will create a eas.json file

Screenshot

Step 4: Open Expo account

  • Click on build details it will redirect you to your expo account.

sc2

  • If you are getting any error while building, then you have to cut down the terminal and try to run build command once again. The downloaded build is in the format of .aab so we have to convert it in .apk.

sc3

Step 5: Convert .aab file to .apk

  • Download the Build Artifact
  • Create a new folder on your desktop name as output.
  • In this folder we have to put two things –
    • 1) bundletool.jar file
    • 2) .aab file
  • For bundle file click on this link https://github.com/google/bundletool/releases
  • Download bundletool-all-1.15.6.jar.

3ag8w336

Step 6 : Open command prompt.

  • Goto output folder.
  • Paste below code
java -jar bundletool.jar build-apks --bundle=filename.aab --output=newfilename.apks --mode=universal
  • If your .aab filename is to longer then you can simply give a name like app.aab and then paste it in above command.
  • Change the output file name as output.apks instead of newfilename.apks

s5

  • Check that output.apks is created in the output folder or not. You can use this .apk file .

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads