Skip to main content

Android

Setup

Starting point is this guide - React Native Section (not expo). Don't forget to install the JDK and set the path accordingly.

The default installed NDK doesn't seem to have the tools required to strip binaries that have been built with ARMEABI support, so it ends up packaging the whole library, which increases the built file size substantially. To fix that, in Android Studio > Configure > SDK Manager > SDK Tools, install NDK (Side by Side).

To be able to successfully build and package the app you also have ot tweak these files:

  1. In android/gradle/wrapper/gradle-wrapper.properties change the distributionUrl like so: distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip.
  2. In android/build.gradle change the minSdkVersion to (at least) 21.

Microsoft App Center

npm install appcenter appcenter-analytics appcenter-crashes --save-exact

Create a new file with the filename appcenter-config.json in android/app/src/main/assets/ with the following content:

{
"app_secret": "THE-ID-FROM-APP-CENTER"
}

Modify the app's res/values/strings.xml to include the following lines:

<string name="appCenterCrashes_whenToSendCrashes" moduleConfig="true" translatable="false">DO_NOT_ASK_JAVASCRIPT</string>
<string name="appCenterAnalytics_whenToEnableAnalytics" moduleConfig="true" translatable="false">ALWAYS_SEND</string>