ALL BUSINESS
COMIDA
DIRECTORIES
EDUCATIONAL
ENTERTAINMENT
FASHION TIPS
FINER THINGS
FREE CREATOR TOOLS
HEALTH
MARKETPLACE
MEMBER's ONLY
MONEY MATTER$
MOTIVATIONAL
NEWS & WEATHER
TECHNOLOGIA
TELEVISION NETWORKS
USA VOTES 2024
VIDEOS
INVESTOR RELATIONS
IN DEVELOPMENT
Posted by - Latinos MediaSyndication -
on - March 4, 2023 -
Filed in - Technology -
-
348 Views - 0 Comments - 0 Likes - 0 Reviews
To allow for multi environment builds, the following Android flavors were set:
productFlavors { development { resValue "string", "app_name", "AppName Dev" applicationId "com.org.nativeapp.development" } staging { resValue "string", "app_name", "AppName Stag" applicationId "com.org.nativeapp.staging" } production { resValue "string", "app_name", "AppName" } }
On package.json, we could then build the app over different environments through the following scripts:
"android": "react-native run-android --mode=developmentDebug --appIdSuffix=development", "android:prod": "react-native run-android --mode=productionDebug", "android:stag": "react-native run-android --mode=stagingDebug --appIdSuffix=staging",Introduction to the Problem
After upgrading a React Native project from 0.67.5 to latest (currently 0.71.3), when running metro through npx react-native start, we now have the possibility to build Android and iOS by simply pressing a key, as shown below:
ProblemNow, being able to directly build from the Metro process is very handy. But because those commands are (presumably) only running react-native run-android and react-native run-ios, those builds fail as, because of the multi environments setup, it'd need to run react-native run-android --mode=developmentDebug --appIdSuffix=development instead.
ConclusionExtra: Out of curiosity, on top of the default commands on the Metro session (r - reload the app, d - open developer menu, i - run on iOS, a - run on Android), would it be possible to add some other custom script?
Any comment on this is deeply appreciated - Thanks a ton in advance!