===================TO RUN A FLAVOR VARIANT ================ Here, in this project, i have setup 2 flavors of app, one is rumahaman and other is tibaybalay. See android/app/build.gradle for reference for setting up different flavors of app
You can run tibaybalay app with this command on your device => npm run androidTibayBalay
similarly,You can run rumahaman app with this command on your device => npm run androidRumahaman
====================TO RELEASE AN APK======================
- cd android
- ./gradlew assembleRelease for example, you can build an release apk of Tibay Balay with this command in this project: ./gradlew assembleTibayBalayRelease similarly, you can build an release apk of Rumahaman with this command in this project: ./gradlew assembleRumahamanRelease
===================FOLLOWING FILES WERE CHANGED WHILE DEMONSTRATING THIS====================
- android/app/build.gradle
- rumahaman and tibaybalay folders in android/app/src were created. The name of this folder should match the flavor name in the android/app/build.gradle file.
- res folder was moved from app/src/main to each individual flavor variant folder leaving AndroidManifest.xml and java folder only in app/src/main directory.
- some scripts were added in package.json files
See this for reference: https://medium.com/@amallick_83138/how-to-manage-multiple-environments-in-a-react-native-app-for-android-6d0e852c10de