美文网首页
升级Xcode12.5 DoraemonKit 编译Error:

升级Xcode12.5 DoraemonKit 编译Error:

作者: 智能老树皮 | 来源:发表于2021-05-06 15:37 被阅读0次

FBRetainCycleDetector编译报错:

Cannot initialize a parameter of type 'id<NSCopying>  _Nonnull' with an rvalue of type 'Class'

解决方案:

Podfile文件中添加以下内容:

post_install do |installer|

 find_and_replace("Pods/FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/FBClassStrongLayout.mm",

      "layoutCache[currentClass] = ivars;", "layoutCache[(id<NSCopying>)currentClass] = ivars;")

end

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

参考链接:

FBRetainCycleDetector官方临时解决方案

相关文章

网友评论

      本文标题:升级Xcode12.5 DoraemonKit 编译Error:

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