0

I am trying to make an apk of my react native app folder. I followed this https://www.youtube.com/watch?v=cws_eQ5LQUk&t=420s tutorial but the resultant file turned out to be app.aab file.

So how can I make it an apk file from this and installed it in another emulator?

Iffat
  • 1,606
  • 4
  • 19
  • 33

1 Answers1

0

There is a good step-by-step tutorial in react documentation.

You have to generate a signed apk file for publishing to Google Play Store. It can be done by following command. But first, you have to generate an upload key and set up gradle variables, check the link above.

$ cd android
$ ./gradlew bundleRelease
Nazar Litvin
  • 758
  • 6
  • 10
  • I followed each step of it. but in the end, it is generating aab file – Iffat Sep 14 '19 at 16:29
  • It should be under `/android/app/build/outputs/apk`, isn't it? – Nazar Litvin Sep 14 '19 at 16:35
  • according to the site, it is in `android/app/build/outputs/bundle/release/app.aab` and I found aab file there. – Iffat Sep 14 '19 at 16:38
  • in `/android/app/build/outputs/apk` there is `app-debug.apk` not `app-release.apk` – Iffat Sep 14 '19 at 16:39
  • After I followed all the spets `app-release.apk` is under `/android/app/build/outputs/apk/release`. Also, try to run gradlew clean before build. `cd android && ./gradlew clean && ./gradlew assembleRelease`. – Nazar Litvin Sep 14 '19 at 16:49
  • BTW, which version of react-native do you use? – Nazar Litvin Sep 14 '19 at 16:51
  • 0.59.8 react native version – Iffat Sep 14 '19 at 16:56
  • If you are letting Google manage the release signing, you can just create an upload signing keystore and produce an `.aab` file. If you want to manage signing completely yourself you can use an `.apk` or `.aab` I believe. – dragon788 Mar 12 '21 at 19:37