React Native项目集成了CodePush热更新,在用cpcn-client工具发布新版本时,在日志栏中打印了如下错误:
Detecting ios app version: The "CFBundleShortVersionString" key in the "ios/xxx/Info.plist" file needs to specify a valid semver string, containing both a major and minor version (e.g. 1.3.2, 1.1). END
这个错误在以前没有遇到过,猜测有可能是React Native与cpcn-client的版本不兼容问题。
为了解决此问题的折腾过程就不说了,直接说解决方案。
打开 iOS 的 Info.plist 文件,找到 CFBundleShortVersionString ,它现在的值应该是 $(MARKETING_VERSION) ,将它改为一个正确的版本号,例如:1.1.0 。
修改完后再次点击“发布新版本”,就不会再出现此错误了。
- quot CFBundleShortVersionString specify Native semverquot cfbundleshortversionstring specify native cfbundleshortversionstring quot codepush过程 number-of-buckets-specified 39 quot json_extract quot rtlvalidateheap specified invalid nginx quot createfile specified semver cfbundleshortversionstring 版本 语义 软件开发semver specified specify