{"id":12416,"date":"2022-02-23T09:38:51","date_gmt":"2022-02-23T09:38:51","guid":{"rendered":"http:\/\/188.166.245.45\/wordpress\/?p=12416"},"modified":"2022-02-23T09:40:18","modified_gmt":"2022-02-23T09:40:18","slug":"react-native-build-release-apk","status":"publish","type":"post","link":"https:\/\/wp.mrteoh.com\/?p=12416","title":{"rendered":"React Native build release APK"},"content":{"rendered":"<div>\n<div><\/div>\n<div>UI Framework :<\/div>\n<div>&#8212;&#8212;&#8212;&#8212;&#8211;<\/div>\n<div>&#8211; React Native Ui Lib<\/div>\n<div><\/div>\n<div><\/div>\n<div>environment setup<\/div>\n<div>&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/div>\n<div>export ANDROID_HOME=$HOME\/Library\/Android\/sdk<\/div>\n<div>export PATH=$PATH:$ANDROID_HOME\/emulator<\/div>\n<div>export PATH=$PATH:$ANDROID_HOME\/tools<\/div>\n<div>export PATH=$PATH:$ANDROID_HOME\/tools\/bin<\/div>\n<div>export PATH=$PATH:$ANDROID_HOME\/platform-tools<\/div>\n<div>export JAVA_HOME=&#8221;\/Applications\/Android Studio.app\/Contents\/jre\/jdk\/Contents\/Home&#8221;<\/div>\n<div><\/div>\n<div><\/div>\n<div>packages<\/div>\n<div>&#8212;&#8212;&#8211;<\/div>\n<div>$ npm cache clean &#8211;force<\/div>\n<div>$ npm cache verify<\/div>\n<div>$ npm install react-native-ui-lib<\/div>\n<div>$ npm i react-native-reanimated react-native-gesture-handler<\/div>\n<div><\/div>\n<div><\/div>\n<div>App icon<\/div>\n<div>&#8212;&#8212;&#8211;<\/div>\n<div>Android :<\/div>\n<div>[ProjectDirectory]\/android\/app\/src\/main\/res\/mipmap-*\/.<\/div>\n<div><\/div>\n<div>iOS :<\/div>\n<div>in Xcode<\/div>\n<div><\/div>\n<div><\/div>\n<div>generate android key<\/div>\n<div>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/div>\n<div>$ keytool -genkey -v -keystore ewallet.keystore -alias ewallet -keyalg RSA -keysize 2048 -validity 10000<\/div>\n<div><\/div>\n<div><\/div>\n<div>What is your first and last name?<\/div>\n<div>\u00a0 [Unknown]:\u00a0 xxxx<\/div>\n<div>What is the name of your organizational unit?<\/div>\n<div>\u00a0 [Unknown]:\u00a0 xxxx<\/div>\n<div>What is the name of your organization?<\/div>\n<div>\u00a0 [Unknown]:\u00a0 xxxx<\/div>\n<div>What is the name of your City or Locality?<\/div>\n<div>\u00a0 [Unknown]:\u00a0 sg<\/div>\n<div>What is the name of your State or Province?<\/div>\n<div>\u00a0 [Unknown]:\u00a0 sg<\/div>\n<div>What is the two-letter country code for this unit?<\/div>\n<div>\u00a0 [Unknown]:\u00a0 sg<\/div>\n<div><\/div>\n<div><\/div>\n<div>build bundle<\/div>\n<div>&#8212;&#8212;&#8212;&#8212;<\/div>\n<div>$ react-native bundle &#8211;platform android &#8211;dev false &#8211;entry-file index.js\u00a0 \u00a0&#8211;bundle-output android\/app\/src\/main\/assets\/index.android.bundle\u00a0 \u00a0&#8211;assets-dest android\/app\/src\/main\/res\/<\/div>\n<div><\/div>\n<div>build release apk<\/div>\n<div>&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/div>\n<div>$ cd android<\/div>\n<div>$ .\/gradlew assembleDebug<\/div>\n<div>$ .\/gradlew installRelease<\/div>\n<div>$ rm -rf .\/android\/app\/src\/main\/res\/raw<\/div>\n<div>$ rm -rf .\/android\/app\/src\/main\/res\/drawable-*<\/div>\n<div>$ adb uninstall com.rnhooktemplate<\/div>\n<div>$ react-native run-android &#8211;variant=release<\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>UI Framework : &#8212;&#8212;&#8212;&#8212;&#8211; &#8211; React Native Ui Lib environment setup &#8212;&#8212;&#8212;&#8212;&#8212;&#8211; export ANDROID_HOME=$HOME\/Library\/Android\/sdk export PATH=$PATH:$ANDROID_HOME\/emulator export PATH=$PATH:$ANDROID_HOME\/tools export PATH=$PATH:$ANDROID_HOME\/tools\/bin export PATH=$PATH:$ANDROID_HOME\/platform-tools export JAVA_HOME=&#8221;\/Applications\/Android Studio.app\/Contents\/jre\/jdk\/Contents\/Home&#8221; packages &#8212;&#8212;&#8211; $ npm cache [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[182],"tags":[],"class_list":["post-12416","post","type-post","status-publish","format-standard","hentry","category-react"],"_links":{"self":[{"href":"https:\/\/wp.mrteoh.com\/index.php?rest_route=\/wp\/v2\/posts\/12416","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.mrteoh.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.mrteoh.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.mrteoh.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.mrteoh.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12416"}],"version-history":[{"count":3,"href":"https:\/\/wp.mrteoh.com\/index.php?rest_route=\/wp\/v2\/posts\/12416\/revisions"}],"predecessor-version":[{"id":12419,"href":"https:\/\/wp.mrteoh.com\/index.php?rest_route=\/wp\/v2\/posts\/12416\/revisions\/12419"}],"wp:attachment":[{"href":"https:\/\/wp.mrteoh.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12416"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.mrteoh.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12416"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.mrteoh.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12416"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}