-
Notifications
You must be signed in to change notification settings - Fork 31
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
Product Flavors | Value null for applicationId in defaultConfig (works without flavors implementation) #75
Comments
@wkoutre any update? |
@pcaro10 I haven't heard anything about this one, no, nor have I looked into it further. In the production apps I manage, I've just been using the workaround I've mentioned above:
|
@wkoutre thanks! I will try |
I am having the same problem and tried various steps with no avail. I had to run the |
I had a similar issue, but for me I needed to adjust the android I have two yaml files, which are setup in the following way: project.ext.flavorEnvMapping = [
prod: "../.env.prod.yaml",
staging: "../.env.staging.yaml",
] and I attempted to do something like the following: defaultConfig {
applicationId <MY_APP_ID>
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode project.config.get("APP_BUILD_NUMBER")
versionName project.config.get("APP_VERSION")
} This however, failed when created an app bundle, with the error: "Version code not found in manifest". I traced the code back to
I went on to print it, inside defaultConfig {
println "MY CONFIG ${project.config}"
applicationId <MY_APP_ID>
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode project.config.get("APP_BUILD_NUMBER")
versionName project.config.get("APP_VERSION")
} The result looked like so: MY CONFIG [prod:[BASE_URL:<OMITTED>, IS_PROD:true, ENVIRONMENT:production, TARGET_NAME:<OMITTED>, APP_NAME:<OMITTED>, APP_BUILD_NUMBER:36, APP_VERSION:1.1.3], staging:[BASE_URL:<OMITTED> IS_PROD:false, ENVIRONMENT:staging, TARGET_NAME:<OMITTED>, APP_NAME:<OMITTED>, APP_BUILD_NUMBER:40, APP_VERSION:1.2.0]] so the My end working solution now looks like this: productFlavors {
prod {
applicationId <PROD_BUNDLE_ID>
versionName project.config.prod.APP_VERION
versionCode project.config.prod.APP_BUILD_NUMBER
}
staging {
applicationId <STAGING_BUNDLE_ID>
versionName project.config.staging.APP_VERION
versionCode project.config.staging.APP_BUILD_NUMBER
}
}
Granted, this is not Ideal, but it works, and achieves the needed result. I hope this helps someone. Although it is kind of a bug to be honest, I would've expected the lib to deliver these values automatically |
I had the same issue when trying to set
|
Describe the bug
When using product flavors implementation,
applicationId project.config.get("APP_ID")
indefaultConfig
isnull
.Steps to Reproduce
app/build.gradle
like this:react-native run-android --variant devDebug
(orcd android; ./gradlew assembleDevDebug
) to see build fail withIf I change to
applicationId String.format("%s", project.config.get("APP_ID"))
then it trows an error about how applicationId is nullproject.ext.flavorEnvMapping
, runyarn rnuc env.staging.yaml
, then runreact-native run-android --variant devDebug
(orcd android; ./gradlew assembleDevDebug
), everything works perfectly without any other changes.Expected behavior
I expect product flavors to work just the same as using the
yarn rnuc
cliIntegration option
rnuc
CLI to inject environment (default integration optionfrom quickstart guide)
option from cookbook:
scheme,
flavors)
react-native-ultimate-config
within monorepo managed withLerna or Yarn Workspaces Monorepo support
Env file
Example of env file that is causing problems
OS
Packages
react-native
: 0.64.2react-native-ultimate-config
: 3.4.1Run
react-native info
and post below:The text was updated successfully, but these errors were encountered: