[英]react native config cannot read env file in ios
我已經按照文檔: https://github.com/luggit/react-native-config#ios直到:Build settings 和 Info.plist 步驟 6 中的可用性。為將生成"tmp.xcconfig"
的方案創建新的構建階段"tmp.xcconfig"
在每次構建之前向 Build Settings 和 Info.plist 公開值(如果使用下面解釋的方法,則此代碼段必須放在"echo... > tmp/envfile"
之后)
echo ".env.staging" > /tmp/envfile
"${SRCROOT}/../node_modules/react-native-config/ios/ReactNativeConfig/BuildXCConfig.rb" "${SRCROOT}/.." "${SRCROOT}/tmp.xcconfig"
"react-native-config": "0.11.7"
很高興看到任何評論
如果您在import Config from 'react-native-config'
時可以在 JS 中看到空配置文件,並且如果您使用的是 Pod,只需添加(沒有react-native link react-native-config
)
pod 'react-native-config', :path => '../node_modules/react-native-config/react-native-config.podspec'
在你的 Podfile 中。
並嘗試更新模塊版本
"react-native-config": "^1.0.0"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.