使用React-native-ble-plx

时间:2018-09-03 23:44:56

标签: reactjs react-native bluetooth bluetooth-lowenergy

所以我一直在遵循本指南:“ https://blog.expo.io/so-you-want-to-build-a-bluetooth-app-with-react-native-and-expo-6ea6a31a151d

在第一步“ 3--IOS设置”的“ pod安装”中,我收到此错误,我不知道为什么,我遵循了确切的指南。

Ibrahims-MacBook-Pro:MyCar ibrahim$ cd ./ios
Ibrahims-MacBook-Pro:ios ibrahim$ pod install
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Pre-downloading: `ExpoKit` from `http://github.com/expo/expo.git`, tag `ios/2.5.10`
Fetching podspec for `Folly` from `../node_modules/react-native/third-party-podspecs/Folly.podspec`
Fetching podspec for `React` from `../node_modules/react-native`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
Fetching podspec for `react-native-ble-plx` from `../node_modules/react-native-ble-plx`
Fetching podspec for `yoga` from `../node_modules/react-native/ReactCommon/yoga`
[!] Unable to find a specification for `react-native-ble-plx-swift` depended upon by `react-native-ble-plx`
Ibrahims-MacBook-Pro:ios ibrahim$ 

这是错误

"[!] Unable to find a specification for `react-native-ble-plx-swift` depended upon by `react-native-ble-plx`"

1 个答案:

答案 0 :(得分:1)

打开位于./ios文件夹内的Podfile并添加此行

pod 'react-native-ble-plx-swift', :path => '../node_modules/react-native-ble-plx'

保存

运行pod install