6

I am creating my own cocoapods. I am getting an error as shown in screenshot. I think , there is some issue with Assets.xcassets folder linking. In case, there is no image in assets.xcassets folder, then there is no issue with it. When I am adding any image in assets, then contents.json will be generated automatically with respect to those images, and then this below issue started coming.

enter image description here

VipinYadav
  • 808
  • 4
  • 16

4 Answers4

6

I have modified these two lines and now it's working.

s.source_files = 'ECGame/**/*.{swift, plist}' s.resources = 'ECGame/**/*.{storyboard,xib,xcassets,json,png}'

VipinYadav
  • 808
  • 4
  • 16
2

You can use following YourPod.podspec file making minor changes

Pod::Spec.new do |s|
    s.name             = 'YourPod'
    s.version          = '0.1.0'
    s.summary          = 'Pod summary here'
    s.description      = 'Use description here and it must be larger than summary'
    s.swift_version = '4.2'
    s.homepage         = 'https://github.com/githubusername/YourPod'
    s.license          = { :type => 'MIT', :file => 'LICENSE' }
    s.author           = { 'Vipin' => 'vipintnk11@gmail.com' }
    s.source           = { :git => 'https://github.com/githubusername/YourPod.git', :tag => s.version.to_s }
    s.ios.deployment_target = '11.0'
    s.source_files = 'ECGame/**/*.{swift, plist}'
    s.resources = 'ECGame/**/*.{png,jpeg,jpg,storyboard,xib,xcassets,json}'
    s.framework = "UIKit"
    s.dependency 'MBProgressHUD'
    s.dependency 'Alamofire'
end
1

Either you do:

s.subspec 'Resources' do |resources|
    resources.resource_bundle = {'ECGame' => ['Resources/**/*.{json,png}']}
end

Or you do:

s.resources = "ECGame/Assets/*.xcassets"
denis_lor
  • 6,212
  • 4
  • 31
  • 55
  • 1
    Thanks a lot. I put as below and now it's working s.source_files = 'ECGame/**/*.{swift, plist}' s.resources = 'ECGame/**/*.{storyboard,xib,xcassets,json,png}' – VipinYadav Feb 05 '20 at 02:29
1

I have same solution as Vipin given with minor correction.

s.source_files = 'RepoName/**/*.{swift}'
s.resources = 'RepoName/**/*.{storyboard,xib,xcassets,json,png, jpg, jpeg, plist}'

I have removed the plist from source file and added into resource file.

Narendra Jagne
  • 436
  • 3
  • 8