react-native-config: Configuration of bundle id in Info.plist not working
When using variables in Info.plist
, the bundle id doesn’t get updated. However, the display name updates as expected. Do you know why?
.env
DISPLAY_NAME=MyApp
BUNDLE_ID=com.mycompany.myapp
Info.plist:
<key>CFBundleDisplayName</key>
<string>__RN_CONFIG_DISPLAY_NAME</string>
<key>CFBundleIdentifier</key>
<string>__RN_CONFIG_BUNDLE_ID</string>
About this issue
- Original URL
- State: open
- Created 7 years ago
- Reactions: 7
- Comments: 25
@SoundBlaster It works! I Just follow these steps below:
Yes
${BUILD_DIR}/GeneratedInfoPlistDotEnv.h
-traditional
having the same issue, app name showing as __RN_CONFIG_DISPLAY_NAME
@luongs3 I just test
__RN_CONFIG_BUNDLE_ID
and it works. In theInfo.plist
:and in the
.env.alpha
:I followed instruction
Did anyone resolve this problem?
My solution was with a combination of Fastlane actions: mainly
update_app_identifier
,update_project_provisioning
andmatch
.Also added
fastlane_require 'dotenv'
at the start of the Fastlane file, so I could load the dov env vars withDotenv.load("../../.env.development")
.It seems to work for me but it also appears to only work when I clean my build folder between switching environments which isn’t ideal.
@jenskuhrjorgensen I was having the same problem, It looks like code signing with Xcode uses the value from the original
Info.plist
to “Check dependencies” before signing, and it uses it without the pre-processing step. I solved it usingfastlane
as @grifotv mentioned. However, if you want to archive from Xcode you’ll have to manually write yourPRODUCT_BUNDLE_IDENTIFIER
before archiving.@danilValeev this works for me unitl I try to upload to app store. Every visible field states the correct app identifier. dev builds also work as expected.
Though the automatically signing says there is an error with my entitlements. Once I change the bundle identifier manually, everything works like a charm. Did you try the app store upload?
@MelonDeng But I still have a problems with Automatically Signing in Xcode. It creates a new provisioning profile and etc. for BundleID “__RN_CONFIG_BUNDLE_ID”. So, I need to manually fix it in GUI. So sad.