From 532b620f332fe63bbe927e5612fe5df00ef0b38f Mon Sep 17 00:00:00 2001 From: Website Deployment Script Date: Tue, 16 Feb 2016 19:20:06 +0000 Subject: [PATCH] Updated docs for next --- releases/next/docs/signed-apk-android.html | 19 ++++--------------- releases/next/versions.html | 2 +- versions.html | 2 +- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/releases/next/docs/signed-apk-android.html b/releases/next/docs/signed-apk-android.html index 5f55bae1f1c..9c7cdd7e161 100644 --- a/releases/next/docs/signed-apk-android.html +++ b/releases/next/docs/signed-apk-android.html @@ -20,21 +20,10 @@ android { } } } -...

Generating the release APK #

If you have a react.gradle file in android/app #

Simply run the following in a terminal:

$ cd android && ./gradlew assembleRelease

If you need to change the way the JavaScript bundle and/or drawable resources are bundled (e.g. if you changed the default file/folder names or the general structure of the project), have a look at android/app/build.gradle to see how you can update it to reflect these changes.

If you don't have a react.gradle file: #

You can upgrade to the latest version of React Native to get this file. Alternatively, you can bundle the JavaScript package and drawable resources manually by doing the following in a terminal:

$ mkdir -p android/app/src/main/assets -$ react-native bundle --platform android --dev false --entry-file index.android.js \ - --bundle-output android/app/src/main/assets/index.android.bundle \ - --assets-dest android/app/src/main/res/ -$ cd android && ./gradlew assembleRelease

In both cases the generated APK can be found under android/app/build/outputs/apk/app-release.apk, and is ready to be distributed.

Testing the release build of your app #

Before uploading the release build to the Play Store, make sure you test it thoroughly. Install it on the device using:

$ cd android && ./gradlew installRelease

Note that installRelease is only available if you've set up signing as described above.

You can kill any running packager instances, all your and framework JavaScript code is bundled in the APK's assets.

Enabling Proguard to reduce the size of the APK (optional) #

Proguard is a tool that can slightly reduce the size of the APK. It does this by stripping parts of the React Native Java bytecode (and its dependencies) that your app is not using.

IMPORTANT: Make sure to thoroughly test your app if you've enabled Proguard. Proguard often requires configuration specific to each native library you're using. See app/proguard-rules.pro.

To enable Proguard, set minifyEnabled to true:

... -android { - ... - buildTypes { - release { - ... - minifyEnabled true - } - } -} -...
Next →

Documentation archive

© 2016 Facebook Inc.

Documentation archive

© 2016 Facebook Inc.

Documentation archive

© 2015 Facebook Inc.

Documentation archive

© 2016 Facebook Inc.