Pod frameworks.sh文件错误

时间:2018-08-23 16:20:47

标签: xcode cocoapods alamofire

我看到以下错误:

Code Signing /Users/mikesimonetta/Library/Developer/Xcode/DerivedData/sorealty- 
bymtwudklcqeahacubxoedmawvut/Build/Products/Debug-appletvsimulator/DEV_So's Realty.app/Frameworks/Alamofire.framework with Identity -
/usr/bin/codesign --force --sign -  --preserve-metadata=identifier,entitlements '/Users/mikesimonetta/Library/Developer/Xcode/DerivedData/sorealty-bymtwudklcqeahacubxoedmawvut/Build/Products/Debug-appletvsimulator/DEV_So's Realty.app/Frameworks/Alamofire.framework'
/Users/mikesimonetta/Desktop/Projects/Clearbridge/sir-tvos/sothebysrealty/Pods/Target Support Files/Pods-So_DEV/Pods-So_DEV-frameworks.sh: eval: line 113: unexpected EOF while looking for matching `''
Command /bin/sh failed with exit code 2

我到处都在寻找解决方案。我已经清理了项目。我已删除派生数据。我删除了工作区/容器/锁定文件,并从头开始构建容器。仍然收到此问题。

在此阻止程序上的任何帮助将不胜感激。预先感谢!

我的Podfile:

    # Uncomment this line to define a global platform for your project
platform :tvos, '9.0'

target 'So_DEV' do
  # Comment this line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for sorealty
  pod 'GooglePlacesAPI', '~> 1.1'
  pod 'Alamofire', '~> 4.7'
  pod 'SWXMLHash', '~> 4.0.0'

end

target 'So_PROD' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!

# Pods for sorealty
pod 'GooglePlacesAPI', '~> 1.1'
pod 'Alamofire', '~> 4.7'
pod 'SWXMLHash', '~> 4.0.0'

end

target 'TopShelf_DEV' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!

# Pods for sorealty
pod 'GooglePlacesAPI', '~> 1.1'
pod 'Alamofire', '~> 4.7'
pod 'SWXMLHash', '~> 4.0.0'

end

target 'TopShelf_PROD' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!

# Pods for sorealty
pod 'GooglePlacesAPI', '~> 1.1'
pod 'Alamofire', '~> 4.7'
pod 'SWXMLHash', '~> 4.0.0'

end

1 个答案:

答案 0 :(得分:0)

发生了同样的问题,并通过在Podfile中添加post_install脚本来更新每个目标的EOF字符来解决。不能完全确定问题的根源,以及为什么我从事的其他项目没有遇到同样的问题。

在此处找到了解决方案/解决方法-https://github.com/CocoaPods/CocoaPods/issues/7090

,并通过对脚本进行一些修改来实现它。现在看起来像这样:

post_install do |installer|
    installer.aggregate_targets.each do |target|
        if target.name == 'Pods-Target_2' || target.name == 'Pods-Target_1'

            frameworkPath = "Pods/Target Support Files/#{target.name}/#{target.name}-frameworks.sh"

            puts "Found #{frameworkPath}"

            text = File.read(frameworkPath)
            new_contents = text.gsub(/'\$1'/, "\\\"$1\\\"")

            File.open(frameworkPath, "w") {|file| file.puts new_contents}

            puts "Updated #{target.name} framework file with proper EOF characters"
        end
    end
end

希望这会有所帮助!