简体   繁体   English

添加 React Native 模块不会向 Podfile 添加行,但 `pod install` 会安装它

[英]Adding React Native module doesn't add line to Podfile, but `pod install` installs it anyway

I added react-native-device-info with npm i react-native-device-info .我用npm i react-native-device-info I'm using React Native 0.61, so I expected that it would automatically add a line in my Podfile for RNDeviceInfo.我使用的是 React Native 0.61,所以我希望它会自动在我的 Podfile 中为 RNDeviceInfo 添加一行。 My Podfile didn't change, BUT when I ran pod install , it said "Installing React Native Device Info".我的 Podfile 没有改变,但是当我运行pod install时,它说“正在安装 React Native Device Info”。 I notice that doing this didn't add a .xcodeproj or .a file to Xcode.我注意到这样做并没有将.xcodeproj.a文件添加到 Xcode。 Can anyone help me understand what's going on?谁能帮我理解发生了什么?

You have to go node_modules folder, and find react-native-device-info folder and final step is remove RNDeviceInfo.podspec file.您必须 go node_modules 文件夹,找到 react-native-device-info 文件夹,最后一步是删除 RNDeviceInfo.podspec 文件。 I recommended you copy RNDeviceInfo.podspec file before removing.我建议您在删除之前复制 RNDeviceInfo.podspec 文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM