I have created sample CocoaPod file and it worked successfully, now on final stage when I am doing Pod Repo Push it showing me error. Below are the command and error which I am getting.
Pod::Spec.new do |s|
s.name = "IDFVSample"
s.version = "1.0.0"
s.summary = "A short description of VFIDOneFramework. Please check this awesome work from me you will like it"
s.description = "This is the best tutorial. Recently given presentation in the world great forum for the member."
s.homepage = "https://github.com/kashiftriffort/IDFVSample"
s.license = "MIT"
s.author = { "KJilani" => "Kashif.triffort#gmail.com" }
s.platform = :ios, "9.0"
s.source = { :git => "https://github.com/kashiftriffort/IDFVSample.git", :tag => "1.0.0" }
s.source_files = "IDFVSample/IDFVSample/IDFVSample.swift"
s.dependency 'Firebase/Core'
end
pod repo push IDFVPodSpecs IDFVSample.podspec --allow-warnings
Validating spec
Cloning spec repo `-1` from ``
[!] Unable to add a source with url `` named `-1`.
You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.
Looks like you have not added the repo containing your specs yet.
Do something like:
pod repo add IDFVSample <git source>
Move your IDFVSample.podspec to the root of your repository(where is already located LICENSE and README files)
Related
For a iOS project we are using a lot of private SDK's. Maybe 10 .framework files and growing. We would like to create a private git repo and dump all the .framework files in the repo. Is it possible cocoapods uses this git repo as a source so we can specify the frameworks we need? Maybe use the vendored_frameworks prop?
Can not find a solution online. Tried it myself without success.
Thanks!
UPDATE
I have a git repo with a branch TEST including 1 .framework file and 1 podspec file
Pod::Spec.new do |s|
s.name = 'xSDK'
s.version = '0.0.1'
s.summary = 'x SDK'
s.homepage = 'https://www.google.com'
s.author = { 'Sample' => 'sample#sample.com' }
s.license = { :type => "MIT", :text => "MIT License" }
s.platform = :ios
s.ios.deployment_target = '13.0'
s.ios.vendored_frameworks = 'x.framework'
end
I have a react native module including swift code that is using the .framework with a podspec file
require "json"
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
Pod::Spec.new do |s|
s.name = "react-native-x-module"
s.version = package["version"]
s.summary = package["description"]
s.homepage = "https://github.com/x"
s.license = "MIT"
s.authors = { "x" => "x#x" }
s.platforms = { :ios => "13.0" }
s.source = { :git => "", :tag => "#{s.version}" }
s.source_files = "ios/**/*.{h,m,mm,swift}"
s.dependency 'xSDK', :git => 'https://git.x.org/x/cocoapods/-/tree/TEST'
end
I want to do something like this, but s.dependency is indeed not correct
We have more react-native-x-module's so it would be nice if we could collect all the .frameworks in a git repo
You host a private pod repository. See the Private Pods guide for a start. The details vary very much based on your local infrastructure. For example, our in-house repo and pods all make use of our GitLab installation.
Basically, you need to set up a Git repo for the specs, and you need to add source <url_to_repo> to your Podfile so CocoaPods can find the private pods. The pods can reference internal Git repositories or other sources. In the end, you'd use an in-house pod repo, and the pods would refer to in-house sources.
For some example, search for something like "cocoapods private repo" to find articles like this describing this in more detail. Most articles I've found set up a private pod repo on GitHub, but you can use your own in-house Git server (which is what my company is doing).
I have a framework that I've built for iOS, dynamic framework with a Universal binary for x86_64 (iosSimulator), arm64 and arm64e.
The framework works fine when I drag it to an app and use it.
Pod repo push works fine when I use a repo on my machine that holds the framework and another specs repo that's on my machine. I created the repos with git init --bare
When I use github and point the spec to the github repo instead of my local repo it fails with ld:framework not found <frameworkName> . When I skip validation and push and and finally use it in an app using the pod file I get the same error, ld:framework not found <frameworkName>.
The only difference is I've moved from my local git repo that holds the framework to one on Github.
Edit:
Pasting podspec below
Pod::Spec.new do |s|
s.name = "frameworkName"
s.version = "0.51.0"
s.summary = "A brief description of frameworkName project."
s.description = <<-DESC
An extended description of frameworkName project.
DESC
s.homepage = "http://your.homepage/here"
s.license = { :type => 'Copyright', :text => <<-LICENSE
Copyright 2018
Permission is granted to...
LICENSE
}
s.author = { "myname" => "" }
s.source = { :git => "<git hub repo>", :tag => "#{s.version}", :branch => "iOS_Framework" }
s.ios.vendored_frameworks = "frameworkName.framework"
s.vendored_frameworks = "frameworkName.framework"
s.ios.deployment_target = '12.0'
s.pod_target_xcconfig = { 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }
s.user_target_xcconfig = { 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }
end
It ended up being a case sensitivity problem. The framework on the repo was named frameworkName.Framework instead of frameworkName.framework. Worked after I changed it.
Not sure why there wasn't an issue with a local git repo.
I'm getting an error when I'm trying to add GeoFire to my iOS Flutter project which has the FlutterFire Database plugin included. This is what the error looks like:
Resolving dependencies of `Podfile`
[!] Unable to satisfy the following requirements:
- `Firebase (~> 2.1)` required by `GeoFire (1.1.0)`
Specs satisfying the `Firebase (~> 2.1)` dependency were found, but they required a higher minimum deployment target.
My podspec file looks like this atm:
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'geofire'
s.version = '0.0.1'
s.summary = 'A new flutter plugin project.'
s.description = <<-DESC
A new flutter plugin project.
DESC
s.homepage = 'http://example.com'
s.license = { :file => '../LICENSE' }
s.author = { 'Your Company' => 'email#example.com' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.dependency 'Flutter'
s.dependency 'GeoFire', '>= 1.1' # Adding GeoFire
s.ios.deployment_target = '8.0'
end
I also tried using the git page in to add Geofire in my podspec file as suggested here: GeoFire giving problems with CocoaPods
s.dependency 'GeoFire', :git => 'https://github.com/firebase/geofire-objc.git'
Is there a (simple) solution for this?
I faced the same kind of issue few days ago.
I think I fixed it by doing the following steps:
Run the command 'pod repo update' (it will update your repo information)
Then run the command 'pod update' (it will update your pods using the latest repo information)
Let me know if this is solving your issue :)
Please try the approach suggested by Bjørn Børresen here:
Since Flutter kind of abstracts away this Cocoapods process. Here's what I did to be able to run "pod repo / update":
Run pod repo update
Set the environment variable FLUTTER_FRAMEWORK_DIR to something that looks like /Users/youruser/bin/flutter/bin/cache/artifacts/engine/ios/. You can do a locate Flutter.podspec to find this directory
From YourFlutterProject/ios run pod update
After this you should be able to run your app again
I am trying to add VPX framework that is required for toxav to be compiled. I have my pod spec file like so:
Pod::Spec.new do |s|
s.name = "toxcore-ios"
s.version = "0.1.3"
s.summary = "Cocoapods wrapper for toxcore"
s.homepage = "https://github.com/dvor/toxcore-ios"
s.license = 'GPLv3'
s.author = { "Dmytro Vorobiov" => "d#dvor.me" }
s.source = {
:git => "https://github.com/dvor/toxcore-ios.git",
:tag => s.version.to_s,
:submodules => true
}
s.platform = :ios, '7.0'
s.requires_arc = true
s.source_files = 'toxcore/toxcore/*.{c,h}', 'toxcore/toxencryptsave/*.{c,h}', 'toxcore/toxav/*.{c,h}'
s.public_header_files = 'toxcore/toxcore/*.h', 'toxcore/toxav/*.h'
s.dependency 'libsodium', '~> 1.0.1'
s.dependency 'libopus', '~> 1.1'
s.ios.vendored_frameworks = 'VPX.framework'
s.prepare_command = 'libvpx/build/make/iosbuild.sh'
end
For what it's worth, the prepare_command creates the VPX.framework. I tried adding the VPX.framework files to the s.source_files and s.public_header_files, however they still receive the same error below when running pod lib lint. I'm not even sure if it's necessary to add it to the s.source_files or s.public_header_files since I believe the s.ios.frameworks already takes care of that?
toxcore/toxav/toxav.h:34:10: fatal error: 'vpx/vpx_image.h' file not found
I came across the same issue this week while linking frameworks in my newly created pod. You should use the --use-libraries option while using lint:
pod lib lint --use-libraries
This option is also available while pushing your pod to the master Cocoapods repository or your own repository.
pod repo push REPO_NAME POD_NAME.podspec --use-libraries
Hope this helps!
I figured out my issue. The VPX framework path was listed as below:
VPX.framework/Headers/vpx/{files.h}
When we use vendored_frameworks it actually only looks under the Header folder for the header files. So instead we had this
VPX.framework/Headers/{looks here}
In which case I had to move the files under vpx , to Header
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