美文网首页
集成ReactNative热更新的坑

集成ReactNative热更新的坑

作者: 李Mr | 来源:发表于2018-03-29 16:29 被阅读56次

之前就想记录下这个问题,现在有时间,就记录一下这个坑。

我们按照ReactNative官网集成ReactNative到原生iOS上的文档往下走的时候,pod install 总是会报下面这样的错

[!] No podspec found for `react-native-update` in `./node_modules/react-native-update`

这是因为没有成功链接到热更新库导致的。我们要在node_modules/react-native-update 文件夹下新建一个文件:react-native-update.podspec  在这个文件中输入以下内容:


require "json"

package = JSON.parse(File.read(File.join(__dir__, "package.json")))Pod::Spec.new do |s|

s.name = "react-native-update"s.version = package["version"]

s.summary = "hot update for react-native"

s.author = "author (https://github.com/reactnativecn)"

s.homepage = "https://github.com/reactnativecn/react-native-pushy"

s.license = "MIT"s.platform = :ios, "7.0"s.source = { :git => "https://github.com/reactnativecn/react-native-pushy.git", :tag => "#{s.version}" }

s.source_files = "ios/**/*.{h,m,c}"

s.libraries = "bz2"

s.dependency "React"

end

保存,然后pod install链接一下就可以了。

相关文章

网友评论

      本文标题:集成ReactNative热更新的坑

      本文链接:https://www.haomeiwen.com/subject/zrjrpxtx.html