美文网首页
iOS AlicloudCrash更新1.2.0版本,编译时l

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

作者: 心猿意码_ | 来源:发表于2022-04-07 14:55 被阅读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

  • 添加后编译通过

相关文章

网友评论

      本文标题:iOS AlicloudCrash更新1.2.0版本,编译时l

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