-
Notifications
You must be signed in to change notification settings - Fork 659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple flavors for android build config results in empty Config
object on the react native side
#467
Comments
Same issue here on RN => 0.0.63. |
Check if proguard is enabled, if so you have to add this in
|
@haseebeqx we have |
@aledustet Why you need to bundle identifier?. If it is for rebranding I think you can add a README instruction for user to update this config also. |
@haseebeqx the way the product is set up, we need to handle two different applications for different flows. Each one is a different product. We are using the different configuration files for different bundle identifiers using schemes on the iOS side. This behavior allows us to have one 'environment' for the iOS native code and the javascript code. The same should be true for the android native code. The equivalent to schemes on android is the product flavors, and those are configured in the same way. Hope this answers your question |
In our case, it doesn't work when we use |
I had the same issue when setting up flavors with an applicationIdSuffix, and the solution was to specify a resValue like this comment mentions: #223 (comment) |
I'm getting this error:
Can anyone help? |
Thanks, It worked with my jitsi-meeting project. |
@aledustet have you found a resolution to this? Facing the same issue as you |
Had the same issue and got it fixed by doing this.
Hope this helps |
We are using RN => 0.61.5, and the latest version of
react-native-config
This is an open-source project, here is the repo. There is a split for two flavors of the applications, one BT and one GPS, on the iOS version, the pre-build scripts copying the right env file on the right Scheme works and each version of the app loads the correct set of
env
variables. When the Android version builds for the GPS flavor the environment variables are made available on thereact-native
side and everything works. Is worth noticing that the default and original configuration was made for the GPS side, using the originalappId
.When the
BT
flavor builds, if we spoof inside thedotenv.gradle
thebuildConfig
is picked up and the right env file is found, we can see it in the build output and if we print theenv
that is being used inside that file it has all the right values. However, as soon as the app builds ourConfig
imported fromreact-native-config
is empty.Things we have tried:
proguard-rules
buildConfig
alone and only using one .env fileThe text was updated successfully, but these errors were encountered: