# How to Generate a React Native Build APK Using Version 0.71.2

> Generate a React Native build APK with version 0.71.2. Follow these steps to configure SDK 33, create a keystore, and build your signed APK.

- Repository: [Meta/react](https://github.com/facebook/react)
- Tags: how-to-guide
- Published: 2026-02-19

---

**To generate a React Native build APK for version 0.71.2, configure your Android project for SDK 33, create a release signing keystore, and run `./gradlew assembleRelease` from the `android` directory to output a signed APK at `android/app/build/outputs/apk/release/app-release.apk`.**

React Native 0.71.2 requires specific toolchain versions and Android SDK configurations to produce production-ready APKs. This guide walks through the complete build process using the source conventions from the `facebook/react` repository, ensuring compatibility with the React 19.3.0 core version specified in [`ReactVersions.js`](https://github.com/facebook/react/blob/main/ReactVersions.js).

## Prerequisites for React Native 0.71.2

Before generating a release build, verify your environment matches the requirements for React Native 0.71.2:

- **Node.js**: Version 18 LTS or later
- **Java Development Kit**: OpenJDK 11 (check with `java -version`)
- **Android Studio**: Arctic Fox 2020.3.1 or later with Android SDK Platform 33 (Android 13)
- **Gradle**: 7.5 or later (handled automatically by the Gradle Wrapper at `./gradlew`)

Install dependencies and clean the Android build cache:

```bash
yarn install
cd android && ./gradlew clean

```

## Configure Android Project Settings

React Native 0.71.2 targets Android SDK 33 by default. Verify these values in your project configuration files.

In `android/build.gradle`, ensure the global SDK versions are set:

```gradle
buildscript {
    ext {
        compileSdkVersion = 33
        buildToolsVersion = "33.0.0"
    }
}

```

In `android/app/build.gradle`, confirm the minimum and target SDK versions:

```gradle
android {
    defaultConfig {
        minSdkVersion = 21
        targetSdkVersion = 33
    }
}

```

Additionally, ensure `android/gradle.properties` contains AndroidX migration flags required by React Native 0.71.2:

```properties
android.useAndroidX=true
android.enableJetifier=true

```

## Set Up Release Signing Configuration

Generate a production keystore if you haven't already. From the project root, run:

```bash
keytool -genkeypair -v -keystore android/app/my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000

```

Add signing credentials to `android/gradle.properties` (keep this file secure and out of version control):

```properties
MYAPP_RELEASE_STORE_FILE=my-release-key.keystore
MYAPP_RELEASE_KEY_ALIAS=my-key-alias
MYAPP_RELEASE_STORE_PASSWORD=your_store_password
MYAPP_RELEASE_KEY_PASSWORD=your_key_password

```

Reference these properties in `android/app/build.gradle` within the `signingConfigs` block:

```gradle
android {
    signingConfigs {
        release {
            if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
                storeFile file(MYAPP_RELEASE_STORE_FILE)
                storePassword MYAPP_RELEASE_STORE_PASSWORD
                keyAlias MYAPP_RELEASE_KEY_ALIAS
                keyPassword MYAPP_RELEASE_KEY_PASSWORD
            }
        }
    }
    buildTypes {
        release {
            signingConfig signingConfigs.release
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

```

## Build the Release APK

With signing configured, generate the release APK using Gradle. From the `android` directory:

```bash
./gradlew assembleRelease

```

The build process compiles JavaScript bundles and native code, outputting the signed APK to:

```

android/app/build/outputs/apk/release/app-release.apk

```

For Google Play Store distribution, generate an Android App Bundle (AAB) instead:

```bash
./gradlew bundleRelease

```

This creates `android/app/build/outputs/bundle/release/app-release.aab`, which is the preferred format for Play Store uploads.

## Verify Version Compatibility and Common Issues

React Native 0.71.2 depends on React 19.3.0 as defined in [`ReactVersions.js`](https://github.com/facebook/react/blob/main/ReactVersions.js) within the `facebook/react` repository. Ensure your app's [`package.json`](https://github.com/facebook/react/blob/main/package.json) pins these exact versions to avoid native module mismatches:

```json
{
  "dependencies": {
    "react": "19.3.0",
    "react-native": "0.71.2"
  }
}

```

If you encounter `Invariant Violation: "NativeModule" is not a registered callable module`, the React core version likely mismatches the React Native native code. Run `yarn install` and clean the Gradle build to resolve cache conflicts.

For Gradle build failures citing "Failed to resolve: com.facebook.react:react-android", verify that `android/build.gradle` includes both `mavenCentral()` and `google()` in the repositories block.

## Summary

- **React Native 0.71.2** requires Android SDK 33, OpenJDK 11, and Node 18 LTS for optimal build performance.
- Configure signing credentials in `android/gradle.properties` and reference them in `android/app/build.gradle` to enable release builds.
- Execute `./gradlew assembleRelease` to generate a signed APK or `./gradlew bundleRelease` for Play Store AAB distribution.
- Match the React core version (19.3.0) specified in [`ReactVersions.js`](https://github.com/facebook/react/blob/main/ReactVersions.js) to prevent runtime native module errors.
- Clean the Gradle cache with `./gradlew clean` before building after version upgrades to prevent resource duplication errors.

## Frequently Asked Questions

### What is the difference between assembleRelease and bundleRelease?

**`assembleRelease`** generates a standard APK file suitable for direct installation via `adb install` or manual distribution, while **`bundleRelease`** creates an Android App Bundle (AAB) that Google Play uses to generate optimized APKs for different device configurations. For Play Store submissions, use `bundleRelease`; for internal testing or sideloading, use `assembleRelease`.

### Where does React Native 0.71.2 specify its Android SDK requirements?

The default SDK versions for React Native 0.71.2 are defined in the template files `android/build.gradle` and `android/app/build.gradle`, setting `compileSdkVersion` and `targetSdkVersion` to 33. These values ensure compatibility with the native modules shipped in the `react-android` artifact.

### How do I fix "Failed to resolve: com.facebook.react:react-android" errors?

This error indicates missing Maven repositories in your `android/build.gradle` file. Add `mavenCentral()` and `google()` to the `allprojects.repositories` block, then sync the project. This allows Gradle to download the React Native 0.71.2 Android dependencies from the correct repositories.

### Can I use a debug build instead of release for testing?

Yes, run `npx react-native run-android` to generate and install a debug APK with the Metro bundler attached. However, debug builds include development menus, unminified JavaScript, and debug symbols, resulting in significantly larger file sizes and slower performance compared to release builds generated via `./gradlew assembleRelease`.