简体   繁体   中英

Cocoapod podspec validation - Unknown DSL error occured

Im trying to upload the new version of my pod to cocoapods spec repo. The current live version is 0.3.1 and it is a framework build with swift 4.2. Now i updated the library and build with Xcode 11.1 (swift 5). But while linting the podspec file, im getting an unknown DSL error in the terminal.

I have tried with changing the name of podspec and with same framework. but no use. anyone please help

pod spec lint AsistaCore.podspec --verbose

Podspec file

Pod::Spec.new do |spec|
  spec.name         = 'AsistaCore'
  spec.version      = '1.0.0'
  spec.summary      = 'Official Asista SDK in Swift to access Asista Platform core feature'

  spec.description      = <<-DESC
    The Asista SDK in Swift Core framework provides:
    * Create new tickets
    * Update Ticket State
    * Add comments to ticket
    * Asset list
    * Update profile
    * Knowledge Base Articles
  DESC

  spec.homepage     = 'https://asista.com/developer'
  spec.license      = { :type => 'MIT', :file => 'LICENSE' }
  spec.authors      = { 'Cherrylabs' => 'vaisakh.kp@cherrylabs.com' }
  spec.documentation_url = 'https://asista.com/developer/docs/asista-sdk-for-ios'

  spec.platform     = :ios
  spec.source       = { :git => 'https://github.com/cherrylabstech/asista-sdk-ios.git', :tag => spec.version }

  spec.swift_version = '5.0'
  spec.ios.deployment_target = '8.0'

  spec.static_framework = true
  spec.ios.vendored_frameworks = 'AsistaSupport/AsistaCore.framework'
end

-> AsistaCore (1.0.0) - ERROR | [iOS] unknown: Encountered an unknown error (Pod::DSLError /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/specification.rb:808:in `rescue in _eval_podspec'

....

...

We ran into this issue when we try creating a release and publishing a library. This error occurs when you are trying to run pod spec lint or pod repo push. The error says "DSLError" and doesn't give much information on what is causing it. I found little help online and some places they say, there could be a syntax error in the podspec file. We didn't have any in our podspec. However, this answer from stackoverflow gave me some direction https://stackoverflow.com/a/64779582

It looks like while making a release for one SDK/library, the pod spec lint and pod repo push validates all the podspecs in the folder besides the ones you ran. I don't know how that works internally. You should look for the following scenarios to identify the issue:

  • If there are other podspecs for capabilities that have different tags(Example: ABC.podspec pointed to source tag 1.0.0-ABC and XYZ.podspec pointed to source tag 2.0.0-XYZ )

  • Multiple podspecs have dependencies on different versions of the same module(Example: Module1.podspec depends on Module 5 version 10.0.0 and Module2.podspec also depends on Module 5 but on the version 11.0.0 ).

  • Syntax errors in any of the podspecs

If you come across either or both 1 & 2, it could be a potential cause for the DSLError.

When you run into this issue, make sure you look for and update the following:

  • All podspecs to have pointed to one source tag

  • All dependencies on a module pointed to one version of it in each capability.

  • Fix the sytanx errors.

This issue will go away or reduce significantly when the SDK libraries can be separated into their repositories instead of all in one repository, or perhaps even by keeping each podspec in their own individual folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM