react-native框架中,在ios資料夾下執行pod install命令時出現的問題。
下面時完整的異常資訊:
[!] CocoaPods could not find compatible versions for pod "React/Core": In Podfile: react-native-fetch-blob (from `../node_modules/react-native-fetch-blob`) was resolved to 0.10.6, which depends on React/Core None of your spec sources contain a spec satisfying the dependency: `React/Core`. You have either: * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`. * mistyped the name or version. * not added the source repo that hosts the Podspec to your Podfile. [!] use_native_modules! skipped the react-native dependency 'react-native-imui'. No podspec file was found. - Check to see if there is an updated version that contains the necessary podspec file - Contact the library maintainers or send them a PR to add a podspec. The react-native-webview podspec is a good example of a package.json driven podspec. See https://github.com/react-native-community/react-native-webview/blob/master/react-native-webview.podspec - If necessary, you can disable autolinking for the dependency and link it manually. See https://github.com/react-native-community/cli/blob/master/docs/autolinking.md#how-can-i-disable-autolinking-for-unsupported-library
可將目錄切換到工程根目錄後,執行以下命令即可解決問題:
grep -rl "s.dependency 'React/Core'" node_modules/ | xargs sed -i '' 's=React/Core=React-Core=g'