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
- Bumped Gradle to 8.8 and minSdkVersion to 24 for React Native compatibility
- Moved repositories from settings.gradle.kts to build.gradle to fix compilation issues
- Added ReactNativeActivity with just 13 lines of Kotlin boilerplate code
- Implemented ReactApplication interface in ApplicationContext for ReactNativeHost setup
- Enabled New Architecture and Hermes with proper autolinking configuration
Android brownfield integration requires more build script manipulation than iOS, but the actual Activity implementation is surprisingly minimal once Gradle is properly configured.
About This Article
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.
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.
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.