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

Change your Windows 8 Bootlogo

THIS IS HOW TO CREATE A CUSTOM BOOT LOGO! Confirmed Working on 8.1 As well! Step 1: Take ownership of your Bootres.dll using the following commands from an Administrator Command Prompt: takeown /f C:\Windows\Boot\Resources\bootres.dll icacls C:\Windows\Boot\Resources\bootres.dll /grant yourusername :f Note that you need to replace "yourusername" with your username... Step 2: Make a folder on your C: drive and call it bootlogo, and copy bootres.dll into it. Step 3: Make a folder called Logos (To edit your images in) Step 4: Your going to need to download some stuff into your bootlogo folder: www.coderforlife.com/projects/win7boot/extras/#signer http://dl.7-zip.org/7z930-x64.msi <--- Install This www.bome.com/products/restorator/downloads <-- I used the full version, however I don't know if the free version will work. ^^^RESHACKER WILL NOT WORK. LEAVES DLL CORRUPT^^^ This has been suggested as a replacement f...

Linux Shell Tips and Tricks

Check if remote port is open with bash: echo > /dev/ tcp / 8.8 . 8.8 / 53 && echo "open" Suspend process:   Ctrl + z Move process to foreground:   fg Generate random hex number where n is number of characters:   openssl rand - hex n Execute commands from a file in the current shell:   source / home / user / file . name Substring for first 5 characters:   $ { variable : 0 : 5 } SSH debug mode:   ssh - vvv user@ip_address SSH with pem key:   ssh user@ip_address - i key . pem Get complete directory listing to local directory with wget:   wget - r -- no - parent -- reject "index.html*" http : //hostname/ -P /home/user/dirs Create multiple directories:   mkdir - p / home / user /{ test , test1 , test2 } List processes tree with child processes:   ps axwef Create war file:   jar - cvf name . war file Test disk write speed:   dd if =...

Why to learn PHP?

PHP is basically an HTML-embedded scripting language that helps in writing dynamically generated webpage. The files underPHP comprise HTML tags, text and scripts witha file extension of “.php”. With the help of PHP, youcan create login pages, forums; design a form, and surveys, to name a few. Though now-a-days people use PHP for the development of websitesand web-applications, few of them still doubt about its capabilities. Here are some facts on why PHP should be chosen over other scripting languages.*.Easy To Use: The scripting language, coding and architecture are easy and simple to use in PHP in comparison toother programming languages.*.Technologically Advanced: PHP supports Linux, MySQL and Apache and is the base for several technologies like, CakePHP and Joomla.*.User-friendly: PHP offers the fast accessibility to the websites, thus immediately calling the databases. It has incredible speed which makes it different and popularamong the users. Moreover, the websites created using...