Choicely RN — Android Integration Guide
Integrate the Choicely React Native SDK into your native Android project. Apps whose screens are built with React Native in Choicely Studio (their navigation links arechoicely://rn/...) need this: with android-core alone those screens stay empty.
This guide targets the published SDK artifacts listed below. It is for teams embedding
Choicely into an existing native Android app. If you want to build and publish an app
without writing code, use Choicely Studio instead.
Versions
Prerequisites
- Node.js >= 20
- Android SDK with CMake and NDK 27.1.12297006
- Git
- Java 17
Project Structure (after setup)
Setup
Step 1 — Clone the Choicely RN starter
The folder must be namedapp-react-nativeby default. To use a different name, setchoicelyRnDiringradle.properties(see Step 2).
npm install also applies the native patches in app-react-native/choicely-android/patches/
and checks them (the starter’s postinstall script).
Step 2 — gradle.properties
A new Android Studio project turns on
org.gradle.configuration-cache=true. Leave it on and
the build fails with “Starting an external process … apply-rn-patches.js during
configuration time is unsupported”.Step 3 — settings.gradle
Use Groovy build files (settings.gradle, build.gradle): rn-starter reads your app’s
namespace from app/build.gradle.
dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) }
block: React Native libraries declare their own repositories. Declare the repositories in the
root build.gradle instead (Step 4).
WhyincludeBuildandreactSettingscan’t be automated by a plugin: They run in Gradle’s settings phase — before any plugin from Maven Central can load. These will always need to be in yoursettings.gradle.
Step 4 — Root build.gradle
Step 5 — App build.gradle
react-native.config.js
rn-starter already ships app-react-native/react-native.config.js. It reads
packageName from the namespace in app/build.gradle, so it needs no edit. If you write
your own, the file name must use dots — NOT react-native-config.js:
Step 5b — Required app colours
The Choicely SDK themes reference these. Without them the build can fail atAndroid resource linking failed … resource color/colorPrimaryDark not found.
File: app/src/main/res/values/colors.xml
Step 6 — Application class
ExtendChoicelyRNApplication instead of Application, initialise the Choicely SDK, then
call the base initReactNative(appKey). It sets up the React Native host, the generated
entry point and the Choicely bridge; do not override it. Set it as android:name of
<application> in AndroidManifest.xml, as in the Quick Start.
Bundle loading explained
By default the SDK loads your app’s remote JS bundle — the React Native screens you built in Choicely Studio — from the Choicely server at runtime. Nothing else is needed for that.Older versions of this page called
ChoicelyRNConfig.serLoadRemoteBundle(...) and overrode
initReactNative. Neither works with android-rn 0.1.0: the method no longer exists, and
the base initReactNative already does what the override did.Artifacts Overview
Gradle Plugin: com.choicely.sdk:android-rn-gradle
Distributed via Maven Central. Provides two plugin IDs:
Runtime Library: com.choicely.sdk:android-rn
AAR library containing:
Transitive dependencies (pulled automatically):
com.choicely.sdk:android-core:1.2.2com.facebook.react:react-android:0.82.0com.facebook.react:hermes-android:0.82.0androidx.databinding:*:8.13.2org.jetbrains.kotlin:kotlin-stdlib:2.4.10
Build Commands
Renaming the RN folder
Change one line ingradle.properties:
