Step 1: Go to Build -> Generate Signed Bundle or APK, a pop up will arise. Choose APK in the pop-up and click on Next.
Step 2: After completing step 1, if you already have a key, make sure you just refer to that and you can release the version of that app but in case if it is the first time it is recommended to create a new key. After creating a new key click on OK and then click on Next.
Step 3: After clicking Next in the next pop-up make sure to choose release as Build Variants and check the two Signature Versions as well. Then click on Finish.
Step 4: After successfully completed these steps you can locate your signed apk at app -> release -> app-release as your apk file.
Want a more fast-paced & competitive environment to learn the fundamentals of Android?
Source: geeksforgeeks