CocoaPod spec: Unable to find other source ref for Model.xcdatamodeld - ios

I am trying to create a pod with CoreData model inside. I've followed the tips to use resources and reserve_path. But when I try to lint the spec with pod lib lint there is this weird error that I don't even understand:
- ERROR | [iOS] unknown: Encountered an unknown error (Unable to find other source ref for /Users/rzolin/Projects/ArmorText/iOS-Pod-Test/SampleMessengerCocoapodFramework/SampleMessengerCocoapodFramework/Code/DataManagement/Model/Model.xcdatamodeld/Model.xcdatamodel/contents for target SampleMessengerCocoapodFramework.) during validation.
The spec is based on couple of subspecs, which could complicate the issue a bit. And search on the Internet didn't produce any help so far.
There is a test spec that replicates the error, if somebody is willing to take a look.
The full spec is here:
Pod::Spec.new do |s|
s.name = 'SampleMessengerCocoapodFramework'
s.version = '0.2.0'
s.summary = 'some desc'
s.description = <<-DESC
some desc
DESC
s.homepage = 'http://www.example.com'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'rzolin' => 'rzolin#gmail.com' }
s.source = { :git => 'https://github.com/rzolin/SampleMessengerCocoapodFramework.git', :tag => s.version.to_s }
# Platform setup
s.requires_arc = true
s.ios.deployment_target = '8.0'
s.default_subspec = 'Core'
### Subspecs
s.subspec 'Core' do |cs|
cs.dependency 'SampleMessengerCocoapodFramework/DataManagement'
cs.dependency 'SampleMessengerCocoapodFramework/Networking'
end
s.subspec 'DataManagement' do |ds|
ds.source_files = 'SampleMessengerCocoapodFramework/Code/DataManagement.h', 'SampleMessengerCocoapodFramework/Code/DataManagement/**/*'
ds.resources = [ 'SampleMessengerCocoapodFramework/Code/DataManagement/Model/Model.xcdatamodeld', 'SampleMessengerCocoapodFramework/Code/DataManagement/Model/Model.xcdatamodeld/*.xcdatamodel' ]
ds.preserve_paths = 'SampleMessengerCocoapodFramework/Code/DataManagement/Model/Model.xcdatamodeld'
end
s.subspec 'Networking' do |ns|
ns.source_files = 'SampleMessengerCocoapodFramework/Code/Networking.h', 'SampleMessengerCocoapodFramework/Code/Networking/**/*.{h,m,swift}'
end
# s.resource_bundles = {
# 'SampleMessengerCocoapodFramework' => ['SampleMessengerCocoapodFramework/Assets/*.png']
# }
# s.public_header_files = 'Pod/Classes/**/*.h'
# s.frameworks = 'UIKit', 'MapKit'
# s.dependency 'AFNetworking', '~> 2.3'
end
I've tried to ask the question in Cocoapods, but was referred here
Any help would be appreciated!

I had the same problem and error message as you.
I wanted to have the .xcdatamodel in my pod.
Here is my solution:
Add only your code in the source_files:
s.source_files = 'MyPodDiR/**/*.{h,m,swift}'
Add your xcdatamodel path as a resources:
s.resources = 'MyPodDir/CoreData/MyPodModel*.xcdatamodeld'

I had the same issue, by including SampleMessengerCocoapodFramework/Code/DataManagement/**/* you are including all files (so the pod tries to include the .xcdatamodel/xcdatamodeld files and that's where you get the error.
I suggest removing the coredatamodel from the sources file.
i.e s.source_files = 'SampleMessengerCocoapodFramework/Code/DataManagement/**/*.{h,m}'
And keep the rest as is, it should work!

Related

ERROR | [iOS] unknown: Encountered an unknown error (Malformed version number string “4.0”) during validation

I'm updating my pod library on cocoapods. but on Validate this by the following command
pod lib lint
i'm facing the following error :
- ERROR | [iOS] unknown: Encountered an unknown error (Malformed version number string “4.0”) during validation.
I tried all, but nothing found usable. Please guide.
#
# Be sure to run `pod lib lint myPod.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'myPod'
s.version = '0.2.1'
s.summary = 'A collection of toolset for image operations.'
# This description is used to generate tags and improve search results.
# * Think: What does it do? Why did you write it? What is the focus?
# * Try to keep it short, snappy and to the point.
# * Write the description between the DESC delimiters below.
# * Finally, don't worry about the indent, CocoaPods strips it!
s.description = <<-DESC
A collection of toolset for image operations.
1. Create Gif from images
2. Create Video from images with background audio.
3. Boomrang.
4. Collage.
DESC
s.homepage = 'https://git.mycompany.com/mycompany/editor'
# s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'Mohit' => 'mohit.tomar#mycompany.ai' }
s.source = { :git => 'https://git.mycompany.com/mycompany/editor.git', :tag => s.version.to_s }
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
s.ios.deployment_target = '10.0'
s.source_files = 'myPod/Classes/**/*'
s.resources = ['myPod/Assets/*']
#s.resource_bundles = {
# 'myPod' => ['myPod/Assets/*']
#}
# s.public_header_files = 'Pod/Classes/**/*.h'
# s.frameworks = 'UIKit', 'MapKit'
# s.dependency 'AFNetworking', '~> 2.3'
end

Invalid `VideoRow.podspec` file: undefined method `join' for "TLPhotoPicker":String

Im confused as to why this error is occuring when I try to create my own podfile
I am following this tutorial here
https://ronakshah.org/How-To-Make-A-Cocoapod-With-Dependencies/
However, when I try to run pod install for the last step it gives me this error
Invalid VideoRow.podspec file: undefined method `join' for "TLPhotoPicker":String
Pod::Spec.new do |s|
s.name = 'VideoRow'
s.version = '0.1.0'
s.summary = 'Eureka row that allows us to take or select a video.'
s.description = <<-DESC
This is an add-on to the many rows that are in the Eureka Community. This row will allow users to select a video from there library to export to a backend service of there choosing.
DESC
s.homepage = 'https://github.com/EurekaCommunity/VideoRow'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'Smiller193' => 'shawn.miller#temple.edu' }
s.source = { :git => 'https://github.com/EurekaCommunity/VideoRow.git', :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/EurekaCommunity'
s.ios.deployment_target = '9.1'
s.source_files = 'VideoRow/Classes/**/*'
s.platform = :ios, "10.0"
s.dependency = 'TLPhotoPicker'
s.dependency = 'Eureka'
s.swift_version = '4.2'
end
This is my podspec
use_frameworks!
target 'VideoRow_Example' do
pod 'VideoRow', :path => '../'
pod 'Eureka'
pod 'TLPhotoPicker'
target 'VideoRow_Tests' do
inherit! :search_paths
end
end
Both of these seem right but I get an error every time I try to run pod install.
There is no = in the dependency sequence.
Do s.dependency 'TLPhotoPicker'. Docs here.

Building a Cocoapods Module error [ARC] xcodebuild: Returned an unsuccessful exit code [duplicate]

This question already exists:
GoogleMapsUtils Framework wrapped in Cocoapods Build error on Xcode
Closed 5 years ago.
I'm quiet new at iOS development, this is my first question at SO. At my company we're trying to convert our app in a Cocoapods module to help as to create diferent apps with similiar functionalities. So far we achive to compile the POD module, but when we're trying to import the classes from the module at the workspace's Example attached we get a "Could not build module 'ProjectCore'
#import <ProjectCore/myProjectCoreClass.h>
No getting more details where the building is failing. Am I missing something? There is any way to know where the building process is failing?
Thanks.
After checking the guide deeply and trying the lint check for the building with:
pod lib lint --verbose --allow-warnings
My project use ARC in only some modules, so the podspec is like this.
Pod::Spec.new do |s|
s.name = 'ProjectCore'
s.version = '0.1.3'
s.summary = 'A short description of ProjectCore.'
s.description = 'This is our core a git with cocoapods - ProjectCore.'
s.homepage = 'https://bitbucket.org/projectcore/ios_projectcore'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'Comapny' => 'info#company.com' }
s.source = { :git => 'https://bitbucket.org/projectcore/ios_projectcore.git', :tag => s.version.to_s }
s.ios.deployment_target = '9.0'
s.frameworks = 'CoreData', 'SystemConfiguration', 'Accelerate', 'CoreGraphics', 'CoreLocation', 'CoreText', 'GLKit', 'ImageIO', 'OpenGLES', 'QuartzCore', 'UIKit', 'AdSupport', "GoogleMapsCore", "GoogleMapsBase", "GoogleMaps", "Crashlytics", "Fabric"
s.library = 'z', 'c++', 'xml2'
s.vendored_frameworks = "StaticLibraries/GoogleMapsServices/GoogleMaps.framework", "StaticLibraries/GoogleMapsServices/GoogleMapsBase.framework", "StaticLibraries/GoogleMapsServices/GoogleMapsCore.framework", 'StaticLibraries/FabricCrashlytics/Crashlytics.framework', 'StaticLibraries/FabricCrashlytics/Fabric.framework'
s.vendored_libraries = 'StaticLibraries/GoogleAnalyticsServices/*.a', 'StaticLibraries/GoogleConversionTracking/*.a'
s.xcconfig = {'OTHER_LDFLAGS' => '-ObjC', 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES', 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2'}
arc_files = 'ProjectCore/**/ActionMenuHelper.{h,m}',
'ProjectCore/**/UnitsFormatter.{h,m}',
'ProjectCore/**/BSKeyboardControls/**/*.{h,m}',
'ProjectCore/**/CellMenuLeft.{h,m}',
'ProjectCore/**/CheckInternetConnection.{h,m}',
(...)
s.requires_arc = false
s.source_files = 'ProjectCore/**/*.{h,m,swift}','StaticLibraries/GoogleAnalyticsServices/*.h','StaticLibraries/GoogleConversionTracking/**/*.h','StaticLibraries/ZLib/*.h','StaticLibraries/XMLParser/*.h'
s.exclude_files = arc_files
s.subspec 'ARC' do |sp|
sp.requires_arc = true
sp.source_files = arc_files
end
s.resource_bundle = { 'ProjectCore' => 'ProjectCore/**/*.{png,jpg,xib,strings}' }
s.dependency 'FBSDKLoginKit', '~> 4.11'
s.dependency 'FBSDKShareKit', '~> 4.11'
s.dependency 'NSHash', '~> 1.1'
(...)
end
But my only error is this one:
- ERROR | [ProjectCore/ARC] xcodebuild: Returned an unsuccessful exit code.
Creating your own CocoaPod is fairly straight forward. If you already
have a separate component, you're most of the way there. This guide is
an overview to the entire process, with the other guides in this
section serving as more of a deep-dive for more advanced users.
https://guides.cocoapods.org/making/making-a-cocoapod.html

Add Already Existing Static framework to cocoapods

I have existing static framework.
Now I want it to be available through cocopods as well.
I am following this tutorial.
My pod File:
#
# Be sure to run `pod lib lint MyiOSSDKFramework.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'MyiOSSDKFramework'
s.version = '2.0.0'
s.summary = 'The MyiOSSDKFramework helps you create apps quickly and effortlessly.
# This description is used to generate tags and improve search results.
# * Think: What does it do? Why did you write it? What is the focus?
# * Try to keep it short, snappy and to the point.
# * Write the description between the DESC delimiters below.
# * Finally, don't worry about the indent, CocoaPods strips it!
s.description = <<-DESC
TODO: SDK description will go here.
DESC
s.homepage = 'https://github.com/xyz/MyiOSSDKFramework'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'Priyanka Mistry' => 'priyanka.mistry#xyz.com' }
s.source = { :git => 'https://github.com/xyz/MyiOSSDKFramework.git', :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/Myio'
s.ios.deployment_target = '7.0'
# s.source_files = 'MyiOSSDKFramework/Classes/*.{h,m}'
s.ios.vendored_frameworks = 'MyIOSDK/MyIO.framework'
s.resources = 'MyIOSDK/MyIO.bundle'
s.frameworks = 'Accounts', 'CFNetwork', 'CoreData', 'CoreGraphics', 'CoreLocation', 'CoreTelephony', 'MobileCoreServices', 'QuartzCore', 'Security', 'Social', 'SystemConfiguration'
s.libraries = 'icucore', 'sqlite3'
s.pod_target_xcconfig = { 'OTHER_LDFLAGS' => '-lObjC' }
end
while running pod lib lint MyiOSSDKFramework.podspec it show successful validation.
but, pod spec lint MyiOSSDKFramework.podspec gives me 2 errors at s.ios.vendored_frameworks and s.resources.
Error Message:
- ERROR | [iOS] file patterns: The `resources` pattern did not match any file.
- ERROR | [iOS] file patterns: The `vendored_frameworks` pattern did not match any file.
My folder structure:
- MyiOSSDKFramework.podspec
- MyIOSDK/
- MyIO.framework
- MyIO.bundle
I can't figure out what is going wrong here.
Did you check if these files exist in the repo at :git => 'https://github.com/xyz/MyiOSSDKFramework.git', :tag => s.version.to_s

Could not add private pod as a dependency in other pod?

I am working on a private pod, and when I tried to add it as a dependency to another private pod I am getting this error while running "Pod Update":
[!] Error installing EEMyPod
[!] Attempt to read non existent folder `/Volumes/Development/Work/Projects/Pods/eagle-eye-ios-pod/Example/Pods/EEMyPod`.
I have no clue why this is happening!
But, while running:
pod spec lint
I am getting this:
Attempt to read non existent folder `/private/tmp/CocoaPods/Lint/Pods/EEMyPod`
which I think might be a clue.
This is my Podfile:
Pod::Spec.new do |s|
s.name = "EEMypod"
s.version = "0.1.0"
s.summary = "A short description of EEMypod."
s.description = <<-DESC
An optional longer description of EEMyPod
* Markdown format.
* Don't worry about the indent, we strip it!
DESC
s.homepage = "https://github.com/Codigami/EEMyPod"
# s.screenshots = "www.example.com/screenshots_1", "www.example.com/screenshots_2"
s.license = 'MIT'
s.author = { "Siddarth Chaturvedi" => "Email ID" }
s.source = { :git => "git#github.com:Codigami/EEMyPod.git", :tag => "0.1.0" }
# s.social_media_url = 'https://twitter.com/kidsid49'
s.platform = :ios, '7.0'
s.requires_arc = true
s.source_files = 'Pod/Classes/*.{h,m}'
s.resource_bundles = {
'AAFNetworking' => ['Pod/Assets/*.png']
}
# s.public_header_files = 'Pod/Classes/**/*.h'
# s.frameworks = 'UIKit', 'MapKit'
# s.dependency 'AFNetworking', '~> 2.3'
end
This sounds very likely that CocoaPods failed to download the dependency while linting the specification. If you run the command again with --verbose it will expose the underlying error from git while cloning the repository. It might be that the tag is missing for the dependency.
CocoaPods 0.35.0.rc2 was changed to provide a better error message (https://github.com/CocoaPods/CocoaPods/issues/2667).

Resources