Pod install : Unable to find a specification for 'Foo' - ios

i am trying to install my custom pod created and when i run the pod install i see below error. Any one can please help I did try similar links on stack overflow but no luck.
Error : Unable to find a specification for 'Foo'.
Terminal Logs :
ExampleApp djrecker$ pod install
Analyzing dependencies
Pre-downloading: `Foo` from `https://github.com/deepesh259nitk/mixedFramework.git`, tag `1.0.7`
[!] Unable to find a specification for 'Foo'.
Pod file
# Uncomment the next line to define a global platform for your project
platform :ios, '11.0'
target 'ExampleApp' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for ExampleApp
pod 'Foo', :git => 'https://github.com/deepesh259nitk/mixedFramework.git', :tag => '1.0.7'
end
More pod commands output : pod try , pod install and pod list
AUK03154:ExampleApp djrecker$ pod try Foo
Updating spec repositories
[!] An unexpected version directory `Foo.xcodeproj` was encountered for the `/Users/djrecker/.cocoapods/repos/deepesh259nitk/Foo` Pod in the `Foo` repository.
AUK03154:ExampleApp itrmg$ pod install
Analyzing dependencies
Pre-downloading: `Foo` from `https://github.com/deepesh259nitk/mixedFramework.git`, tag `1.0.7`
[!] Unable to find a specification for 'Foo'.
AUK03154:ExampleApp djrecker$ pod list | grep Foo
AUK03154:ExampleApp djrecker$
pod spec file
Pod::Spec.new do |s|
s.name = "Foo"
s.version = "1.0.7"
s.summary = "This is a iOS framework containing both objective c and swift code"
s.description = "This is a iOS framework containing both objective c and swift code and shows how modules with with POD"
s.homepage = "https://github.com/deepesh259nitk/mixedFramework"
s.license = "MIT"
s.author = { "Deepesh" => "deepesh259nitk#gmail.com" }
s.platform = :ios, "11.0"
s.source = { :git => "https://github.com/deepesh259nitk/mixedFramework.git", :tag => "1.0.7" }
#s.source_files = "Foo/**/*.{h,m,swift}"
#s.source_files = "Foo/**/*.{modulemap}"
#s.source_files = "Foo/**/*.private.modulemap"
# s.exclude_files = "Classes/Exclude"
# s.public_header_files = "Foo/*.h"
s.vendored_frameworks = 'Foo/Foo.framework'
end

Put the podspec in the top level directory at github.com/deepesh259nitk/mixedFramework

Related

no such module 'Firebase' when creating own pod

I am trying to create a new framework called Experiments. It is wrapping Firebase RemoteConfig APIs for any app I may build using it.
When I run the following command pod lib lint Experiments.podspec, I get the following output with errors.
- ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
- NOTE...
- NOTE...
.
.
- ERROR | [iOS] xcodebuild: <path/to/file>: error: no such module 'Firebase'
Here is my Podfile
platform :ios, '13.0'
target 'Experiments' do
pod 'Firebase'
pod 'Firebase/RemoteConfig'
target 'ExperimentsTests' do
# Pods for testing
end
end
Here is a relevant portion of my podspec file
Pod::Spec.new do |s|
s.name = 'Experiments'
s.version = '0.1.3'
s.summary = 'This pod allows A/B Testing.'
s.description = <<-DESC
This pod facilitates AB Testing. Currently, it is powered by Firebase only.
DESC
s.license = { :type => 'MIT', :file => 'LICENSE.txt' }
s.ios.deployment_target = '13.0'
s.source_files = "Experiments/*.{swift}"
s.swift_version = "5.0"
s.frameworks = 'UIKit', 'Foundation'
s.dependency 'Firebase'
s.dependency 'Firebase/RemoteConfig'
end
I was able to successfully build my framework on XCode after pod install.
I tried using s.static_framework = true in .podspec file but I keep getting an error.
Please post a comment if you need clarity.
s.static_framework = true is required.
There's likely no reason to depend on the Firebase pod.
s.dependency 'FirebaseRemoteConfig' without the slash is more likely to work.
If you're still seeing errors with these changes, please include them in the question.

Empty podspec for vendored_framework (The spec is empty...)

I've successfully compiled a framework using Cocoapods Packager
When attempting to lint the podspec that contains that framework, I'm getting the following error:
ERROR | File Patterns: The spec is empty (no source files, resources, resource_bundles, preserve paths, vendored_libraries, vendored_frameworks, dependencies, nor subspecs).
My podspec is simple and looks like this:
Pod::Spec.new do |s|
s.name = 'MyFramework'
s.module_name = 'MyFramework'
s.version = '0.0.1'
s.summary = 'Summary goes here...'
s.license = 'MIT'
s.homepage = 'http://GITHUB_ACCOUNT.com'
s.frameworks = ["CoreData", "CoreGraphics", "CoreImage", ...more frameworks]
s.requires_arc = true
s.source = {
:git => "https://github.com/GITHUB_ACCOUNT/MyFramework.git",
:tag => s.version.to_s
}
s.ios.platform = :ios, '9.0'
s.ios.preserve_paths = 'MyFramework.embeddedframework/MyFramework.framework'
s.ios.public_header_files = 'MyFramework.embeddedframework/MyFramework.framework/Versions/A/Headers/*.h'
s.ios.vendored_frameworks = 'MyFramework.embeddedframework/MyFramework.framework'
end
The basic format of the podspec is actually generated by Cocoapods-Packager. I've ensured that the following paths in the podspec all point to the expected files:
s.ios.preserve_paths = 'MyFramework.embeddedframework/MyFramework.framework'
s.ios.public_header_files = 'MyFramework.embeddedframework/MyFramework.framework/Versions/A/Headers/*.h'
s.ios.vendored_frameworks = 'MyFramework.embeddedframework/MyFramework.framework'
Running pod spec lint --verbose first tells me that ** BUILD SUCCEEDED **', but then generates the error.
Using the framework in a project via pod update works! But I can't get the pod to lint, so I'll never be able to submit it to the Cocoapods repo.
Note that all of the silly paths in the podspec I've pasted here ('http://GITHUB_ACCOUNT.com') are just placeholders and are valid paths in my actual podspec.
I'm using cocoapods 0.39.0.
Any ideas?
Found out what was wrong here.
s.ios.platform = :ios, '9.0'
means that the linter will build for ALL platforms.
The podspec as created by Cocoapods-Packager initially has this:
s.platform = :ios, '9.0'
s.ios.platform = :ios, '9.0'
At some point I inadvertently deleted the first line, I guess. At any rate, the absence of s.platform tells the linter that you want to test on all platforms.
See valid = spec.available_platforms.send(fail_fast ? :all? : :each) do |platform| here
I never expected to be testing on all platforms, only iOS. It turns out that the linter was failing while testing for watchOS, which I don't care about...
Hopefully this will help someone who makes the same mistake!

Building a Cocoapod with Swift and dependency on Objective-C framework

I know there are already a few questions on this theme here on SO, but very few have accepted answers, and I don't think I have found the exact same problem as mine.
I'm building a Swift pod, and in my code I rely on the Google Maps iOS SDK, which is bundled as a .framework file. The project builds OK in Xcode, however I have troubles publishing the lib to Cocoapods.
I managed to have a Podspec file that almost validates using the pod lib lint command. However, now that I've added the Google-Maps-iOS-SDK pod as a dependency in the Podspec file, it fails with the following message:
$ pod lib lint
[!] The 'Pods' target has transitive dependencies that include static
binaries:
(/private/var/folders/n2/qyjfpk6n7zz_mngtwswlmsy00000gn/T/CocoaPods/Lint/Pods/Google-Maps-iOS-SDK/GoogleMaps.framework)
$
Is this expected? Why can't I add the Google Maps iOS SDK as a pod reference in my own Swift-based pod?
Here's the Podspec:
Pod::Spec.new do |s|
s.name = '(name)'
s.version = '1.0.0'
s.summary = '(summary)'
s.platforms = { :ios => '8.0', :osx => '10.10' }
s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.10'
s.license = { :type => 'BSD', :file => 'LICENSE' }
s.source_files = 'Sources/*.{h,swift}', '*.framework'
s.source = { :git => "https://github.com/(Github repo).git", :tag => "1.0.0" }
s.requires_arc = true
s.frameworks = "Foundation", "CoreLocation"
s.author = { 'Romain L' => '(email)' }
s.dependency 'Google-Maps-iOS-SDK'
end
If I don't include the Google Maps iOS SDK as a dependency, then pod lib lint fails in the Bridging Header, and complains it cannot find <GoogleMaps/GoogleMaps.h> (file not found).
I'm stuck, and I don't know if it's a bug from Cocoapods 0.36 (still in Beta) or if I'm doing something wrong.
Thanks for your help!
I finally found another thread on SO dealing with similar problems: Linker errors in a Swift project with Google Maps for iOS added via CocoaPods.
It appears that the errors were due to a combination of bad Podspec file (on the Google Maps iOS SDK side), and bugs in Cocoapods 0.36 Beta.
It's actually possible to workaround the issues by using #fz.'s revised Podspec file for Google Maps: https://stackoverflow.com/a/28471830/145997. Another article that also was of great interest to understand how the vendored_frameworks setting works in Podspec is: http://codereaper.com/blog/2014/creating-a-pod-with-crashreporter/.
So, to correctly import the Google Maps iOS SDK in a Pod project, first use the following Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
# altered version of Google's Podspec
pod 'Google-Maps-iOS-SDK', :podspec => "https://raw.githubusercontent.com/Reflejo/GoogleMapsPodspec/master/Google-Maps-iOS-SDK.podspec.json"
use_frameworks! # don't forget this!
I'm now able to reference Google Maps classes from my Swift code simply by doing import GoogleMaps. And, to distribute the Pod, my final Podspec now resembles the following:
Pod::Spec.new do |s|
s.name = 'MyPod'
s.version = '1.0.0'
s.homepage = "https://github.com/..."
s.summary = '(pod summary)'
#s.screenshot = ""
s.author = { 'Romain L' => '(email)' }
s.license = { :type => 'BSD', :file => 'LICENSE' }
s.social_media_url = "https://twitter.com/_RomainL"
s.platforms = { :ios => '8.0' }
s.ios.deployment_target = '8.0'
s.source_files = 'MyCode/*.{h,swift}'
s.module_name = 'MyPod'
s.source = { :git => "https://github.com/....git", :tag => "1.0.0" }
s.requires_arc = true
s.libraries = "c++", "icucore", "z" # required for GoogleMaps.framework
s.frameworks = "AVFoundation", "CoreData", "CoreLocation", "CoreText", "Foundation", "GLKit", "ImageIO", "OpenGLES", "QuartzCore", "SystemConfiguration", "GoogleMaps" # required for GoogleMaps.framework
s.vendored_frameworks = "Dependencies/GoogleMaps.framework" # Put the Google-provided framework in that subfolder of your Pod project
#s.dependency 'Google-Maps-iOS-SDK' # Careful! this will cause errors if enabled!
end
I am now able to start a new iOS app in Xcode and use the following Podfile to link against my own pod, itself referencing the Google Maps iOS SDK:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
pod 'MyPod'
use_frameworks! # do not forget this!
Not that easy, but feasible after all! Hoping Google will soon patch its Podspec file for Swift developments, though.

Attempting to add OpenTok 2.3 as a local cocoapod

I need to add OpenTok 2.3 to a project that uses cocoapods, however only 2.1.7 is present in the pods repository or on github, so I have downloaded the framework locally. My folder structure looks something like this:
project-
|
Podfile
project.xcodeproj
frameworks/
|
OpenTokSDK-WebRTC.podspec
OpenTok-iOS-2.3.0/
|
OpenTok.framework
And the contents of the OpenTokSDK-WebRTC.podspec file is:
Pod::Spec.new do |s|
s.name = 'OpenTokSDK-WebRTC'
s.version = '2.3'
s.authors = 'TokBox'
s.summary = 'The OpenTok iOS SDK lets you use OpenTok video sessions in apps you build for iPad, iPhone, and iPod touch devices.'
s.homepage = 'https://github.com/opentok/opentok-ios-sdk-webrtc/'
s.license = {
:type => 'Apache'
}
s.source = {
:path => './OpenTok-iOS-2.3.0'
}
s.platforms = {
:ios => '5.0'
}
s.source_files = 'Opentok.framework/Versions/A/Headers/*.h'
s.resources = 'Opentok.framework/Versions/A/Resources/opentok.bundle'
s.frameworks = [
"Opentok",
"UIKit",
"CoreMedia",
"CoreVideo",
"CoreAudio",
"CoreTelephony",
"CFNetwork",
"AVFoundation",
"SystemConfiguration",
"Security",
"QuartzCore",
"AudioToolbox",
"OpenGLES",
"MobileCoreServices"
]
s.libraries = [
"stdc++",
"z"
]
s.xcconfig = {
:FRAMEWORK_SEARCH_PATHS => "\"frameworks/OpenTokSDK-WebRTC/\""
}
s.preserve_paths = 'Opentok.framework'
s.requires_arc = false
end
The relevant line in the Podfile is
pod 'OpenTokSDK-WebRTC', :path => "frameworks"
When I run 'pod install' everything appears to run fine, however there is no OpenTokSDK folder in the Pods directory and I get a file not found error in xcode when trying to include . Does anyone know what I am missing?
Thanks for your help.
As I found on their Blog Here is the link new-in-ios-10-the-best-webrtc-apps-yet. you need to Add pod 'OpenTok' in your pod file. So updated version of talk box is Added in your Project. and Now Open your xcworkspace file inplace of xcodeproj file .
Here is my Podfile ,
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'ProjectName' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
pod 'AFNetworking', '~> 3.0'
pod 'OpenTok'
# Pods for ProjectName
target 'ProjectNameTest' do
inherit! :search_paths
# Pods for testing
end
target 'ProjectNameUITests' do
inherit! :search_paths
# Pods for testing
end
end
Note :- If you are using Swift then please uncomment # use_frameworks!
After updating your pod file enter "pod install" command in your terminal. and Tokbox will successfully install in your project.

Podspec validates but files are not installed

I'm in the process of writing my very first pod spec, and while I have managed to write a spec that passes validation and pod installĀ seems to install the pod OK the actual source-files are nowhere to be found in my workspace. This is my podfile:
platform :ios, '7.0'
xcodeproj 'NORLabelNodeiOStest'
pod 'NORLabelNode', :path => '~/Programmering/Development/NORLabelNodePodSpec'
pod 'AFNetworking'
As you can see the NORLabelNode pod is installed through a local version of the podspec which looks like this:
Pod::Spec.new do |s|
s.name = "NORLabelNode"
s.version = "0.9.2"
s.summary = "Extension of Apple's SKLabelNode. Allowing multiple lines through the use of \n in the text-string. "
s.description = <<-DESC
Behaves like an ordinary SKLabelNode with the one difference that adding newline characters to the text- property actually adds line-breaks. This is achieved by creating SKLabelNodes as child-nodes, but keeping these as part of the internal (private) logic.
DESC
s.homepage = "https://github.com/nickfalk/NORLabelNode.git"
s.license = 'MIT'
s.author = { "T. Benjamin Larsen" => "benjamin.larsen#noreagle.no" }
s.source = {
:git => "https://github.com/nickfalk/NORLabelNode.git",
:tag => 'v0.9.2'
}
s.social_media_url = 'https://twitter.com/noreagle'
s.platform = :ios, '7.0'
s.ios.deployment_target = '7.0'
s.osx.deployment_target = '10.9'
s.requires_arc = true
s.frameworks = 'SpriteKit'
s.source_files = 'NORLabelNode.{h,m}'
end
Running pod install gives no indication that anything has gone amiss:
Analyzing dependencies
Fetching podspec for `NORLabelNode` from `~/Programmering/Development/NORLabelNodePodSpec`
Downloading dependencies
Installing AFNetworking (2.2.3)
Installing NORLabelNode (0.9.2)
Generating Pods project
Integrating client project
[!] From now on use `NORLabelNodeiOStest.xcworkspace`.
The AFNetworking pod installs the files as expected, but my own NORLabelNode does not. Anyone?
As you can see the NORLabelNode pod is installed through a local version of the podspec which looks like this
That's not how the path option works. It expects a path to the project itself, not the spec.
From the docs:
Using this option CocoaPods will assume the given folder to be the root of the Pod and will link the files directly from there in the Pods project.
If you would like to just use your spec without adding it to the master repo you can create your own repo of specs (docs). Or just place your spec in the correct folder structure in ~/.cocoapods/repos/master

Resources