Skip to main content

Generate release mode APK for React-Native project to publish on PlayStore


Good Day All! I hope you are doing Good.

From last couple of days, Me and my friends were doing comparative study of ionic3 and react-native. During that period, we were struggling to generate release mode APK for React-Native project.

Finally, we came across following solution:
 
1.      Create and then copy a keystore file to android/app

keytool -genkey -v -keystore mykeystore.keystore -alias mykeyalias -keyalg RSA -keysize 2048 -validity 10000
 
2.      Setup your gradle variables in android/gradle.properties

MYAPP_RELEASE_STORE_FILE=mykeystore.keystore
MYAPP_RELEASE_KEY_ALIAS=mykeyalias
MYAPP_RELEASE_STORE_PASSWORD=*****
MYAPP_RELEASE_KEY_PASSWORD=*****
 
3.      Add signing config to android/app/build.gradle
 
android {
    signingConfigs {
        release {
            storeFile file(MYAPP_RELEASE_STORE_FILE)
            storePassword MYAPP_RELEASE_STORE_PASSWORD
            keyAlias MYAPP_RELEASE_KEY_ALIAS
            keyPassword MYAPP_RELEASE_KEY_PASSWORD
        }
    }
    buildTypes {
        release {
            signingConfig signingConfigs.release
        }
    }
}

4.      Generate your release APK:
 
cd android && ./gradlew assembleRelease

5.      Your APK will get generated at: android/app/build/outputs/apk/app-release.apk

Special Thanks to Tyler Buchea : http://blog.tylerbuchea.com/react-native-publishing-an-android-app/

Comments

Popular posts from this blog

Easy Way to Calculate Remainder of Long Division

       Most of the calculators unable to calulate Remainder of long division. Today I am going to show you a easy way to Calculate Remainder of Long Division using square-and-multiply algorithm. Consider example as (25) 17 % 77 As we know,             25 17 = 25 16 x 25 1 So we perform steps as follows:             25 1 % 77 = 25             25 2 % 77 = 9             25 4 % 77 = 9 2 % 77 = 4             25 8 % 77 = 4 2 % 77 = 16             25 16 % 77 = 16 2 % 77 =25 Since, 17 = 16 + 1 we stopped after 25 16 % 77  Final computation,           ...

8 Good Android Tutorials For Newbies

   ...

Torvalds Announces Linux 3.16-rc4

Linux founder, Linus Torvalds has officially announced the fourth Release Candidate (RC) version of the upcoming Linux kernel 3.16. The RC4 is a successor to Linux 3.16-rc3. It is now available for download and testing. However, since it is a development version, it should not be installed on production machines.      The latest release candidate mainly concentrates on drivers (gpu, usb, scsi, sound), filesystems (btrfs, ext4) and arch updates (mostly arm). "Things have calmed down nicely, and everything seems pretty normal. Maybe some of the calm has been due to people starting to take off for summer and (in the US) the 4th of July week, but whatever the reason, both the diffstat and the logs look nice and fairly small." Torvalds said in the release note. The latest release candidate mainly concentrates on drivers (gpu, usb, scsi, sound), filesystems (btrfs, ext4) and arch updates (mostly arm). Earlier, Torvalds announced the third Release Candidate (RC) v...