Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding a fat binary framework to Artifactory Cocoapods repository

I'm trying to deploy a fat binary .framework into an Artifactory Cocoapods repository, but I'm receiving an error for podspec parsing shown in the Artifactory logs during the deployment of the .tar.gz file.

Steps to reproduce:

  1. Compressed a folder containing FRAMEWORK.framework and the FRAMEWORK.podspec into a FRAMEWORK.tar.gz file (as described in the written documentation and shown in the video tutorial).
  2. Deployed the FRAMEWORK.tar.gz pod up to the Artifactory instance using the curl script described in “Set Me Up”:

    curl -u<USER>:<PASSWORD> -XPUT https://<COMPANY>.jfrog.io/<COMPANY>/cocoapods-local/<FRAMEWORK>/<VERSION>/ -T <FRAMEWORK>.tar.gz.

The cocoapods-local repo didn’t automatically put the FRAMEWORK.podspec in the .specs folder as shown in the video tutorial. In the system logs from Artifactory are lines containing the error:

2019-01-14 20:16:29,717 [http-nio-8081-exec-79] [INFO ] (o.a.e.UploadServiceImpl:376) - Deploy to 'cocoapods-local: FRAMEWORK/FRAMEWORK.tar.gz' Content-Length: 27614214

2019-01-14 20:16:30,278 [http-nio-8081-exec-79] ERROR - Error while extracting metadata from pod: Unable to parse spec.

However, the FRAMEWORK.podspec had passed validation when I used pod spec lint from the terminal. The FRAMEWORK.podspec is

Pod::Spec.new do |s|
  s.name = "<FRAMEWORK>"
  s.version = "<VERSION>"
  s.ios.deployment_target = '9.0'
  s.summary = "<Framework>"
  s.description  = <<-DESC
                   <FRAMEWORK>
                  DESC

  s.homepage = "http://www.<COMPANY>.com"
  s.license      = { :type => 'proprietary', :text => <<-LICENSE
                     This software is only permitted to be used
                     by employees of <COMPANY> or
                     of its partners.
                     LICENSE
                   }
  s.author = { "company" => "[email protected]" }
  s.source = { :http => "https://<COMPANY>.jfrog.io/<COMPANY>/cocoapods-local/<FRAMEWORK>/<VERSION>/<FRAMEWORK>.tar.gz", :type => 'tgz'}
  s.preserve_paths = "<FRAMEWORK>.framework*"
  s.vendored_frameworks = "<FRAMEWORK>.framework"
end
like image 597
T Sands Avatar asked Jan 14 '19 20:01

T Sands


1 Answers

Went through the same issue for days!

Finally found out that the .tar.gz that I was generation on my MacOS machine was using a bsd tar(comes with it by default). Running the same commands from a Linux machine worked!

The one that works is gnu tar. Install it using 'brew install gnu-tar'

Link for using gnu tar : https://medium.com/@fullsour/installing-gnu-tar-on-mac-827a494b1c1

The pod should get pushed to Jfrog artifactory then! :D

like image 116
Umair Ahmad Avatar answered Sep 26 '22 00:09

Umair Ahmad