首页 > 编程知识 正文

vue-cli failed to download,buildplayerwindow+buildmethod

时间:2023-05-03 13:39:06 阅读:162828 作者:1763

环境信息执行命令:

npx react-native info的结果如下:

npxreact-native info [ 20336034:42 ] infofetchingsystemandlibrariesinformation . system 3360 OS : MAC OS 11.3 CPU : () system 3360 OS : MAC OS 11.3核心(TM ) i7 1MB/16.00GB外壳:8 ) /典雅的白猫/zsh binaries 336014.15.2 node yarn :1.22.10-/usr/local /典雅的白猫/yaya NPM watchman 3360 not found manager usr/local /典雅的白猫/pod sdks : IOs SDK : platforms : IOs 14.5、驱动程序工具包20.4、macOS 11.3和watch OS 7.4安卓SDK : API levels :23、28、29、30 build tools 336028.0.3、29.0.2、 30.0.3系统图像3360安卓- 30|googleapisintelx 86 atomandroidndk : not found ides : androidstudio :4.1 ai-201 . 12典雅的白猫/xcodebuildlanguages : Java :1.8.0 _ 271--/usr /典雅的白猫/javacnpmpackages 3360 @ react-native-communes CLI : not found react 336017.0.1=17.0.1 react-native :64.0=0. 64.0 react-native-MAC OS 3360 not found

thefollowingbuildcommandsfailed :

compilec/users/it key/library/developer/xcode/derived data/speed rn-gdnmwquzchcterhjmywhtacsnjev/build/interm flipper-folly.build/objects-normal/x86 _ 64/distributed mutex.o/users/it key/MAC synchron ization/distribution

(1故障) )。

信息--verboseflagformoredetails。

错误命令错误代码1。

info visit 3359 yarn pkg.com/en/docs/CLI/runfordocumentationaboutthiscommand。

故障: 1

解决方案注释掉临时解决方案(简单粗暴的)修复/IOs/podfileflipper相关内容。

# enables flipper.# # notethatifyouhaveuse _ frameworks! enabled,flipperwillnotworkand # youshoulddisablethenextline.# use _ flipper! () post _ install do|installer|# react _ native _ post _ install ) end这是暂时的解决方案,不知道后面有什么危险。 实际上可以正常工作。

方法2 (推荐)修正/ios/Podfile的内容如下。

详细的修改操作:

注释掉以下内容:

use_flipper! (post _ install do|installer|react _ native _ post _ install ) insta

ller) end

并把此处替换为:

#⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄修复iOS 14.5新建RN0.64无法运行⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄ def find_and_replace(dir, findstr, replacestr) Dir[dir].each do |name| text = File.read(name) replace = text.gsub(findstr,replacestr) if text != replace puts "Fix: " + name File.open(name, "w") { |file| file.puts replace } STDOUT.flush end end Dir[dir + '*/'].each(&method(:find_and_replace)) end post_install do |installer| flipper_post_install(installer) find_and_replace("Pods/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h", "atomic_notify_one(state)", "folly::atomic_notify_one(state)") find_and_replace("Pods/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h", "atomic_wait_until(&state, previous | data, deadline)", "folly::atomic_wait_until(&state, previous | data, deadline)") end#⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃修复iOS 14.5新建RN0.64无法运行⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃

最终文件如下:

require_relative '../node_modules/react-native/scripts/react_native_pods'require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'platform :ios, '10.0'target 'speed2' do config = use_native_modules! use_react_native!( :path => config[:reactNativePath], # to enable hermes on iOS, change `false` to `true` and then install pods :hermes_enabled => false ) target 'speed2Tests' do inherit! :complete # Pods for testing end # Enables Flipper. # # Note that if you have use_frameworks! enabled, Flipper will not work and # you should disable the next line. #use_flipper!() #post_install do |installer| # react_native_post_install(installer) #end#⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄修复iOS 14.5新建RN0.64无法运行⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄ def find_and_replace(dir, findstr, replacestr) Dir[dir].each do |name| text = File.read(name) replace = text.gsub(findstr,replacestr) if text != replace puts "Fix: " + name File.open(name, "w") { |file| file.puts replace } STDOUT.flush end end Dir[dir + '*/'].each(&method(:find_and_replace)) end post_install do |installer| flipper_post_install(installer) find_and_replace("Pods/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h", "atomic_notify_one(state)", "folly::atomic_notify_one(state)") find_and_replace("Pods/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h", "atomic_wait_until(&state, previous | data, deadline)", "folly::atomic_wait_until(&state, previous | data, deadline)") end#⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃修复iOS 14.5新建RN0.64无法运行⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃end 总结

方法二最终实现思路就是修改这个文件达到修复无法启动的问题。

Pods/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h

理论上等到Flipper-Folly文件更新以后,这个问题应该就会不存在了,期待它官方更新。

RN0.63.3测试

有网友评论0.63版本报错,我来实测一下。

创建0.63的项目 npx react-native init AwesomeProject --version 0.63.3 运行测试 不对Podfile做修改

报错如下:

修改/ios/Podfile注释掉Flipper相关的内容。 修改/ios/Podfile注释掉Flipper相关的内容。删除/ios/Pod目录删除/ios/Podfile.lock执行 pod install --verboseyarn ios运行项目运行成功!
方法二修改/ios/Podfile 内容 修改/ios/Podfile修改后内容如下: require_relative '../node_modules/react-native/scripts/react_native_pods'require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'platform :ios, '10.0'target 'AwesomeProject' do config = use_native_modules! use_react_native!(:path => config["reactNativePath"]) target 'AwesomeProjectTests' do inherit! :complete # Pods for testing end # Enables Flipper. # # Note that if you have use_frameworks! enabled, Flipper will not work and # you should disable these next few lines. #use_flipper! #post_install do |installer| # flipper_post_install(installer) #end #⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄修复iOS 14.5新建RN0.64无法运行⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄ def find_and_replace(dir, findstr, replacestr) Dir[dir].each do |name| text = File.read(name) replace = text.gsub(findstr,replacestr) if text != replace puts "Fix: " + name File.open(name, "w") { |file| file.puts replace } STDOUT.flush end end Dir[dir + '*/'].each(&method(:find_and_replace)) end post_install do |installer| flipper_post_install(installer) find_and_replace("Pods/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h", "atomic_notify_one(state)", "folly::atomic_notify_one(state)") find_and_replace("Pods/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h", "atomic_wait_until(&state, previous | data, deadline)", "folly::atomic_wait_until(&state, previous | data, deadline)") end #⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃修复iOS 14.5新建RN0.64无法运行⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃endtarget 'AwesomeProject-tvOS' do # Pods for AwesomeProject-tvOS target 'AwesomeProject-tvOSTests' do inherit! :search_paths # Pods for testing endend 删除/ios/Pod目录删除/ios/Podfile.lock执行 pod install --verboseyarn ios运行项目运行成功!
参考

https://github.com/facebook/react-native/issues/31179

https://github.com/facebook/flipper/issues/2215

https://github.com/facebook/react-native/issues/31179

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。