Software Mansion Mariusz Stanisz

How Software Mansion Adds React Native to Signal Open Source App: Part 2 (Android)

Original post Adding React Native to Signal Open Source App: Part 2 (Android)

Article Summary

Mariusz Stanisz from Software Mansion just cracked the Android side of brownfield React Native integration. If you thought iOS was tricky, wait until you see the Gradle gymnastics required for Signal's Android app.

This is part 2 of integrating React Native into Signal's open source app, focusing entirely on Android. While iOS had its challenges, the Android implementation required deeper build script modifications, strategic repository restructuring, and careful Activity setup to get React Native running in a production brownfield environment.

Key Takeaways

Critical Insight

Android brownfield integration requires more build script manipulation than iOS, but the actual Activity implementation is surprisingly minimal once Gradle is properly configured.

Continue reading

What This Article Covers

Problem

Signal's Android build needed Gradle 8.8 and minSdkVersion 24 for React Native compatibility. The original setup used Gradle 8.6 and minSdkVersion 21, so dependencies had to be carefully verified and adjusted.

Solution

Mariusz Stanisz added the org.gradle.dependency.verification=lenient flag and set up reactNativeArchitectures for armeabi-v7a, arm64-v8a, x86, and x86_64. This enabled local builds while keeping Hermes and New Architecture support intact.

Impact

The brownfield integration resulted in a working React Native implementation with just 13 lines of Kotlin boilerplate in ReactNativeActivity. New screens can now be built as standard React Native applications without needing extra native code.

The article reveals a non-standard Gradle trick (dependency verification mode) that's not in the official docs but essential for local builds.

This page summarizes “Adding React Native to Signal Open Source App: Part 2 (Android)” by Software Mansion, published Dec 13, 2024. All credit for the original work goes to the authors.

Read the original on blog.swmansion.com (opens in new tab)

AI tools for React Native

Browse all AI tools →