iOS AlicloudCrash更新1.2.0版本,编译时l

2022-04-07  本文已影响0人  心猿意码_

在Podfile文件添加如下:

source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/aliyun/aliyun-specs.git'

target 'EMASDemo' do
  use_frameworks!
  pod 'AlicloudCrash' , '~> 1.2.0'

end

######################以下是添加部分##################
#处理 layoutCache[currentClass] = ivars报错
post_install do |installer|
    ## Fix for XCode 12.5
    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|
      FileUtils.chmod("+w", name) #add
      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

上一篇 下一篇

猜你喜欢

热点阅读