# React Native Bare Workflow Closed Testing Playbook: Gradle Signing, NDK r28 & Hermes R8

> Harden bare `android/app/build.gradle` pipelines for React Native 0.76–0.78+: upload keystores, CMake 16 KB page flags, R8 ProGuard keep rules, and 14-day Play Console release automation.

- **Canonical URL**: https://gootester.com/frameworks/react-native-cli
- **Config File**: android/build.gradle & android/app/build.gradle
- **Build Command**: `cd android && ./gradlew clean bundleRelease --no-daemon --stacktrace`

```groovy
android {
    namespace "com.example.rnbareapp"
    compileSdk rootProject.ext.compileSdkVersion // 36
    ndkVersion "28.0.13004108"
    defaultConfig {
        applicationId "com.example.rnbareapp"
        minSdkVersion rootProject.ext.minSdkVersion // 24
        targetSdkVersion rootProject.ext.targetSdkVersion // 35
        versionCode 3
        versionName "1.0.2"
    }
    buildTypes {
        release {
            signingConfig signingConfigs.release
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
        }
    }
}
```

## Critical Play Console Gotchas
1. **Committing debug signingConfig inside release buildTypes**: React Native CLI templates initialize release.signingConfig to signingConfigs.debug so ./gradlew bundleRelease succeeds locally without external credentials. Replace that placeholder with signingConfigs.release backed by CI keystore environment variables before uploading your signed bundle to Google Play Console.
2. **Custom C++ TurboModules compiled with 4 KB ELF alignment**: Bare React Native projects with custom CMakeLists.txt or older NDK r25/r26 toolchains emit 4 KB aligned .so binaries such as libappmodules.so. Upgrade to React Native 0.77+, AGP 8.7+, and NDK r28 so 16 KB page sizes pass.
3. **Missing ProGuard keep rules for TurboModules and Retrofit DTOs**: Turning on minifyEnabled in bare React Native strips @DoNotStrip JNI bindings and JSON model fields unless proguard-rules.pro preserves com.facebook.jni.**, com.facebook.react.turbomodule.**, and your API serialization classes. Always verify release split APKs locally using bundletool before inviting closed testers.
4. **ABI split configurations conflicting with Android App Bundle delivery**: Legacy bare projects often enable splits.abi { enable true } to shrink standalone APK downloads. When building an .aab via bundleRelease, disable manual ABI splits so Google Play App Signing dynamically slices arm64-v8a and armeabi-v7a.

## Hardening Bare Gradle Pipelines Before Inviting 12+ Closed Testers

Teams using the React Native Bare Workflow (`@react-native-community/cli`) manage `android/build.gradle`, `android/app/build.gradle`, `AndroidManifest.xml`, and native CMake/JNI linkers directly rather than delegating native generation to cloud builders. That control unlocks custom C++ JSI modules, background services, and bespoke Android flavors, but it also means every Gradle misconfiguration lands squarely in your Closed Testing track. Before uploading `app-release.aab` to Play Console, confirm `compileSdkVersion = 36`, `targetSdkVersion = 35` (or `36`), `hermesEnabled = true` in `gradle.properties`, and an isolated `signingConfigs.release` block reading keystore credentials from CI environment variables rather than tracked repository files.
Because React Native's `bundleRelease` task invokes Metro (`react-native bundle`) to compile `index.android.bundle` into Hermes bytecode (`hermesc`) and simultaneously invokes R8 across all Java/Kotlin autolinked modules, local debug runs never exercise your production binary layout. Before exposing your build to GOOtester's consented human testers, run `bundletool build-apks --bundle=android/app/build/outputs/bundle/release/app-release.aab --output=app.apks --mode=default` and install the split APKs onto a physical device to confirm zero JNI `UnsatisfiedLinkError` or missing reflection crashes on cold boot.
Also verify whether `android/app/build/outputs/mapping/release/mapping.txt` and merged native debug symbols (`native-debug-symbols.zip`) are produced during `./gradlew bundleRelease`. Attaching both artifacts to your Closed Testing release in Play Console ensures Android Vitals translates obfuscated Kotlin frames and `libappmodules.so` addresses into actionable source lines.

## Diagnosing ANRs, Main-Thread Bridge Stalls & 16 KB Native Libraries

In bare React Native apps, Application Not Responding (ANR) events — exceeding Google Play's strict 0.47% user-perceived ANR threshold — most commonly originate from synchronous native module initialization Inside `MainApplication.onCreate()`, heavy encrypted storage reads blocking the Android UI thread for >5 seconds, or deadlocks between background BroadcastReceivers and the ReactInstanceManager lifecycle. When closed testers open your app on mid-range Snapdragon 6-series or Dimensity 7000 hardware under real cellular latency, synchronous startup work that takes 800 ms on a flagship test phone can stall for 5.5 seconds and record a Play Console ANR.
GOOtester's Standard ($12, 15 human testers for 16 days) and Premium ($20, 25 human testers for 24 days) tiers pair real human tester enrollment with separate automated physical-device ARM64 ADB QA runs. Those ADB runs execute deterministic cold-start, warm-start, and UI navigation sweeps while recording `dumpsys meminfo` RAM PSS, `dumpsys gfxinfo` janky-frame ratios, and crash/ANR exits — always kept strictly separate from your human tester headcount.
For Android 15/16 readiness, run `llvm-objdump -p` against every `.so` inside `app-release.aab` (`libhermes.so`, `libjsi.so`, `libfbjni.so`, `libmmkv.so`, `libvisioncamera.so`). Any library showing `align 2**12` (4 KB) instead of `align 2**14` (16 KB) requires updating the autolinked npm dependency or passing `ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON` to CMake under NDK r28.

## Automating Multi-Release Closed Testing Loops via GitHub Actions

Bare React Native repositories shine when wired to deterministic CI/CD release loops during the 14-day closed testing window. Configure a GitHub Actions workflow triggered on version tags (`v1.0.1`, `v1.0.2`) that caches `~/.gradle/caches` and `node_modules`, runs `./gradlew bundleRelease`, uploads the signed `.aab` to your Play Console Closed Testing track via the Google Play Developer API (`edits.bundles.upload` + `edits.tracks.update`), and immediately notifies GOOtester's `/api/v1/ci/release` bridge using `Authorization: Bearer gt_live_example_token_12345`.
Shipping two or three versioned releases across your 14-to-24-day campaign accomplishes two critical goals without interrupting opt-in continuity: existing human testers receive seamless Play Store updates (or prompts via `sp-react-native-in-app-updates`), and your Play Console release log accumulates clear, timestamped evidence of defect resolution that you can reference verbatim in Google's three Production Access questions.
Remember that GOOtester's service clock starts only after your Closed Testing track and `testers@gootester.com` Google Group configuration are verified live, and Google Play alone evaluates app quality, Android Vitals stability, and testing telemetry to grant or deny Production Access.
