1

I have created a library in Swift and is trying to upload the library to cocoapods(I am not sure if this is possible, but I assume it has to be). I have never uploaded a library to cocoapods before, so I am unaware of how to do this. I already have the library up in GitHub.

This is what I tried:

Opened the terminal and typed in the following command:

pod spec create JHProgressHUD

This created a JHProgressHUD.podspec file. I replaced the entire default contents of the file with the following:

Pod::Spec.new do |spec|
spec.name         = 'JHProgressHUD'
spec.version      = '1.0.0'
spec.license      = { :type => 'MIT' }
spec.homepage     = 'https://github.com/harikrishnant1991/JHProgressHUD'
spec.authors      = { 'Harikrishnan T' => 'harikrishnant1991@yahoo.com' }
spec.summary      = 'IOS HUD Swift Library'
spec.source       = { :git => 'https://github.com/harikrishnant1991/JHProgressHUD.git', :tag => '1.0.0' }
spec.ios.deployment_target = '7.0'
spec.platform = :ios, '7.0'
spec.source_files = 'JHProgressHUD.swift'
end

Then I tried the following command:

pod spec lint JHProgressHUD.podspec

But I am getting the following error:

 -> JHProgressHUD (1.0.0)
    - ERROR | [xcodebuild]  error: /Applications/Xcode 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: unknown option character `X' in: -Xlinker

Analyzed 1 podspec.

[!] The spec did not pass validation.

What is causing this error? Since this is the first time I am trying to add a library to cocoapods, I am not sure if this is happening since this is a swift library. I have tried the library in a project and it is compiling and running fine. Can anyone guide me on how to add a library to cocoapods? I have found only a few number of tutorials and none of them was much helpful. Is it possible to add a swift library to cocoapods?

Harikrishnan
  • 7,765
  • 13
  • 62
  • 113

1 Answers1

0

I don't know if the same problem with you

Error when compiling a static library using Swift "unknown option character `X' in: -Xlinker"

https://github.com/CocoaPods/CocoaPods/issues/2226

they still working on it https://github.com/CocoaPods/CocoaPods/issues/2272

there is an alternative for upload your swift library

http://www.swifttoolbox.io/ https://www.cocoacontrols.com/

Community
  • 1
  • 1
ingrid
  • 47
  • 3