How to customise synthetic PodFile IN KMM shared library - cocoapods

I am facing some problem to build kmm shared library. It was due to platform version.
here is my podspec file
shared/build/cocoapods/synthetic/IOS/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.1.99. (in target 'FirebaseCore' from project 'Pods')
Pod::Spec.new do |spec|
spec.name = 'shared'
spec.version = '1.0'
spec.homepage = 'Link to the Shared Module homepage'
spec.source = { :http=> ''}
spec.authors = ''
spec.license = ''
spec.summary = 'Test'
spec.vendored_frameworks = 'build/cocoapods/framework/shared.framework'
spec.libraries = 'c++'
spec.ios.deployment_target = '14.1'
spec.dependency 'FirebaseAnalytics'
spec.dependency 'FirebaseAppCheck'
spec.dependency 'FirebaseAuth'
spec.dependency 'FirebaseCore'
spec.dependency 'FirebaseCrashlytics'
spec.dependency 'FirebaseFirestore'
spec.dependency 'FirebaseMessaging'
spec.dependency 'FirebaseRemoteConfig'
spec.dependency 'FirebaseStorage'
spec.dependency 'SQLCipher'
spec.pod_target_xcconfig = {
'KOTLIN_PROJECT_PATH' => ':shared',
'PRODUCT_MODULE_NAME' => 'shared',
}
spec.script_phases = [
{
:name => 'Build shared',
:execution_position => :before_compile,
:shell_path => '/bin/sh',
:script => <<-SCRIPT
if [ "YES" = "$COCOAPODS_SKIP_KOTLIN_BUILD" ]; then
echo "Skipping Gradle build task invocation due to COCOAPODS_SKIP_KOTLIN_BUILD environment variable set to \"YES\""
exit 0
fi
set -ev
REPO_ROOT="$PODS_TARGET_SRCROOT"
"$REPO_ROOT/../gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework \
-Pkotlin.native.cocoapods.platform=$PLATFORM_NAME \
-Pkotlin.native.cocoapods.archs="$ARCHS" \
-Pkotlin.native.cocoapods.configuration="$CONFIGURATION"
SCRIPT
}
]
end
Generated podfile in .../shared/build/cocoapods/synthetic/IOS
source 'https://cdn.cocoapods.org'
target 'ios' do
use_frameworks!
pod 'FirebaseAnalytics'
pod 'FirebaseAppCheck'
pod 'FirebaseAuth'
pod 'FirebaseCore'
pod 'FirebaseCrashlytics'
pod 'FirebaseFirestore'
pod 'FirebaseMessaging'
pod 'FirebaseRemoteConfig'
pod 'FirebaseStorage'
pod 'SQLCipher'
end
is there anyway i can modify this file (not manual) like this
source 'https://cdn.cocoapods.org'
target 'ios' do
use_frameworks!
platform :ios, '14.1'
pod 'FirebaseAnalytics'
pod 'FirebaseAppCheck'
pod 'FirebaseAuth'
pod 'FirebaseCore'
pod 'FirebaseCrashlytics'
pod 'FirebaseFirestore'
pod 'FirebaseMessaging'
pod 'FirebaseRemoteConfig'
pod 'FirebaseStorage'
pod 'SQLCipher'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
puts target.name
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.1'
config.build_settings['ENABLE_BITCODE'] = 'Yes'
config.build_settings['DEBUG_INFORMATION_FORMAT'] = 'dwarf-with-dsym'
config.build_settings['VALID_ARCHS[sdk=iphonesimulator*]'] = 'x86_64'
end
end
end

Related

Removing linked Pods_framework in post_install Podfile hook

I currently have the following situation in my flutter iOS/Android development process:
Every time flutter build runs it executes pod install which installs the regular Flutter Podfile
# Uncomment this line to define a global platform for your project
platform :ios, '10.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'false'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def parse_KV_file(file, separator='=')
file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path
return [];
end
generated_key_values = {}
skip_line_start_symbols = ["#", "/"]
File.foreach(file_abs_path) do |line|
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
plugin = line.split(pattern=separator)
if plugin.length == 2
podname = plugin[0].strip()
path = plugin[1].strip()
podpath = File.expand_path("#{path}", file_abs_path)
generated_key_values[podname] = podpath
else
puts "Invalid plugin specification: #{line}"
end
end
generated_key_values
end
target 'Runner' do
use_frameworks!
use_modular_headers!
# Flutter Pod
copied_flutter_dir = File.join(__dir__, 'Flutter')
copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
# Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
# That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
# CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.
generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
unless File.exist?(generated_xcode_build_settings_path)
raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];
unless File.exist?(copied_framework_path)
FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
end
unless File.exist?(copied_podspec_path)
FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
end
end
# Keep pod path relative so it can be checked into Podfile.lock.
pod 'Flutter', :path => 'Flutter'
# Plugin Pods
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
system('rm -rf .symlinks')
system('mkdir -p .symlinks/plugins')
plugin_pods = parse_KV_file('../.flutter-plugins')
plugin_pods.each do |name, path|
symlink = File.join('.symlinks', 'plugins', name)
File.symlink(path, symlink)
pod name, :path => File.join(symlink, 'ios')
end
end
target 'OneSignalNotificationServiceExtension' do
use_frameworks!
pod 'OneSignal', '>= 2.9.3', '< 3.0'
end
as seen at the end to enable OneSignal push notifications in my app, I've added the OneSignalNotificationServiceExtension. Since the Flutter Runner needs use_frameworks!, I have to add this line to the OneSignal Extension target as well.
This leads to the following file being included unter "General" > "Framework and Libraries" on my OneSignal Target ("Pods_OneSignalNotificationServiceExtension.framework"):
wrongly linked file
But this file probably doesn't exist so the build fails.
If I manually remove this file from XCode, the build works.
But since running Flutter in debug mode from my IDE runs pod install again, I can't remove this link, so my idea was to automate the removing in the post_install hook inside the Podfile.
But since I'm neither really familiar with Ruby nor seem to be able to find good documentation for methods/properties in this callback, I'm not getting it to work.
Here's something I've tried so far:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
if target.name == 'Pods-OneSignalNotificationServiceExtension'
all_filerefs = installer.pods_project.files
all_filerefs.each do |fileref|
#puts(fileref.path)
if fileref.path.end_with? "Pods_OneSignalNotificationServiceExtension.framework"
puts("Found Pods_OneSignalNotificationServiceExtension.framework fileref.")
build_phase = target.frameworks_build_phase
#puts("Determining if build phase needs correction.")
#all_filerefs.delete(fileref)
build_phase.remove_file_reference(fileref)
puts("Removing Pods_OneSignalNotificationServiceExtension.framework from OneSignalNotificationServiceExtension target")
end
end
end
end
end
But neither removing it from all_filerefs nor build_phase.remove_file_reference is quite working. Does anybody know how I can access the linked files from the "Framework and Libraries" section in XCode and how to remove said .framework-file?
Thanks a lot!
With the right google search I've managed to find a single result regarding this topic: https://titanwolf.org/Network/Articles/Article?AID=18711f19-4d55-49b9-a49e-8c4652dc0262#gsc.tab=0
I've took his function from "Fourth, add or remove framework to target"
def updateCustomFramework(project,target,path,name,command)
# Get useful variables
frameworks_group = project.groups.find { |group| group.display_name == 'Frameworks' }
frameworks_build_phase = target.build_phases.find { |build_phase| build_phase.to_s == 'FrameworksBuildPhase' }
embed_frameworks_build_phase = nil
target.build_phases.each do |phase|
if phase.display_name == 'Embed Frameworks'
embed_frameworks_build_phase = phase
end
# puts phase
end
if command == :add
# Add new "Embed Frameworks" build phase to target
if embed_frameworks_build_phase.nil?
embed_frameworks_build_phase = project.new(Xcodeproj::Project::Object::PBXCopyFilesBuildPhase)
embed_frameworks_build_phase.name = 'Embed Frameworks'
embed_frameworks_build_phase.symbol_dst_subfolder_spec = :frameworks
target.build_phases << embed_frameworks_build_phase
end
# Add framework search path to target
['Debug', 'Release'].each do |config|
paths = ['$(inherited)', path]
orgpath = target.build_settings(config)['FRAMEWORK_SEARCH_PATHS']
if orgpath.nil?
puts "path is empty----------"
target.build_settings(config)['FRAMEWORK_SEARCH_PATHS'] = paths
else
puts "path is not empty----------"
paths.each do |p|
if !orgpath.include?(p)
orgpath << p
end
end
end
end
# Add framework to target as "Embedded Frameworks"
framework_ref = frameworks_group.new_file("#{path}#{name}")
exsit = false
embed_frameworks_build_phase.files_references.each do |ref|
if ref.name = name
exsit = true
end
end
if !exsit
build_file = embed_frameworks_build_phase.add_file_reference(framework_ref)
frameworks_build_phase.add_file_reference(framework_ref)
build_file.settings = { 'ATTRIBUTES' => ['CodeSignOnCopy'] }
end
else
frameworks_build_phase.files_references.each do |ref|
#puts(ref.path)
if ref.path == "#{name}"
puts "delete #{name}"
frameworks_build_phase.remove_file_reference(ref)
#embed_frameworks_build_phase.remove_file_reference(ref)
break
end
end
end
end
And only changed if ref.name == "#{name}" to if ref.path == "#{name}".
I also realized that I can't use the pods_projects from the installer but need to open the xcodeproj-file myself. Here is my final post_install script:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
project_path = 'Runner.xcodeproj'
project = Xcodeproj::Project.open(project_path) # Opening the Runner.xcodeproj in the same folder as the Podfile
project.targets.each do |target|
if target.name == "OneSignalNotificationServiceExtension" # Find the OneSignal Target
updateCustomFramework(project, target, '', 'Pods_OneSignalNotificationServiceExtension.framework', ':remove') # Run the function on the target with the framework name
end
end
project.save() # Don't forget to save the project, or the changes won't stay
end
after that a flutter clean was necessary and afterwards the flutter build works like a charm. Hopefully in the future this will save someone 6 hours of time.

Firebase Admob build fails during Archive

My app in general works fine but when trying to set up for release the build fails because "Module'firebase_admob'not found"
//
// Generated file. Do not edit.
//
#import "GeneratedPluginRegistrant.h"
#if __has_include(<firebase_admob/FLTFirebaseAdMobPlugin.h>)
#import <firebase_admob/FLTFirebaseAdMobPlugin.h>
#else
#import firebase_admob;
#endif
#if __has_include(<webview_flutter/FLTWebViewFlutterPlugin.h>)
#import <webview_flutter/FLTWebViewFlutterPlugin.h>
#else
#import webview_flutter;
#endif
#implementation GeneratedPluginRegistrant
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
[FLTFirebaseAdMobPlugin registerWithRegistrar:[registry registrarForPlugin:#"FLTFirebaseAdMobPlugin"]];
[FLTWebViewFlutterPlugin registerWithRegistrar:[registry registrarForPlugin:#"FLTWebViewFlutterPlugin"]];
}
#end
I coded the app in android studio, and am following the guide for release at https://flutter.dev/docs/deployment/ios
I believe the issue may have to do with not installing the admob pod into my podfile, but I have never had to do that before. But here is my podfile anyways:
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def parse_KV_file(file, separator='=')
file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path
return [];
end
generated_key_values = {}
skip_line_start_symbols = ["#", "/"]
File.foreach(file_abs_path) do |line|
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
plugin = line.split(pattern=separator)
if plugin.length == 2
podname = plugin[0].strip()
path = plugin[1].strip()
podpath = File.expand_path("#{path}", file_abs_path)
generated_key_values[podname] = podpath
else
puts "Invalid plugin specification: #{line}"
end
end
generated_key_values
end
target 'Runner' do
use_frameworks!
use_modular_headers!
# Flutter Pod
copied_flutter_dir = File.join(__dir__, 'Flutter')
copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
# Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
# That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
# CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.
generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
unless File.exist?(generated_xcode_build_settings_path)
raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];
unless File.exist?(copied_framework_path)
FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
end
unless File.exist?(copied_podspec_path)
FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
end
end
# Keep pod path relative so it can be checked into Podfile.lock.
pod 'Flutter', :path => 'Flutter'
# Plugin Pods
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
system('rm -rf .symlinks')
system('mkdir -p .symlinks/plugins')
plugin_pods = parse_KV_file('../.flutter-plugins')
plugin_pods.each do |name, path|
symlink = File.join('.symlinks', 'plugins', name)
File.symlink(path, symlink)
pod name, :path => File.join(symlink, 'ios')
end
end
# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
install! 'cocoapods', :disable_input_output_paths => true
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
I had the same problem, and found the solution here: https://github.com/flutter/flutter/issues/47394
It seems like you need to open Runner.xcworkspace instead of Runner.xcodeproj when you archive.

Xcode warning: Multiple targets match implicit dependency for product

I have an app that comes in two flavors (paid and free). One of my frameworks is called AppBootstrap, which has two subspecs (FreeVersion and PaidVersion)
Now Xcode keeps giving this annoying warning (I aim for zero warnings in my project so I do not just want to ignore it, slippery slope and stuff like that ;) )
Multiple targets match implicit dependency for product reference 'AppBootstrap.framework'. Consider adding an explicit dependency on the intended target to resolve this ambiguity. (in target 'The Flight Tracker Free' from project 'The Flight Tracker')
Target 'AppBootstrap-FreeVersion' (in project 'AppBootstrap')
Target 'AppBootstrap-PaidVersion' (in project 'AppBootstrap')
I googled it a bit but I could not find how to solve this.
I tried
* adding it in the 'Link Binary With Libraries' build phase but that did not solve it.
* adding it to the dependencies phase but they do not show up there.
* changing the '-framework AppBootstrap' in 'Build settings => Other Linker Flags' to '-framework AppBootstrap-FreeVersion' but that just ends up in errors.
My podfile (simplified)
source 'custom-pods/link'
source 'https://cdn.cocoapods.org/'
platform :ios, '9.0'
install! 'cocoapods',
:generate_multiple_pod_projects => true,
:incremental_installation => true
use_frameworks!
inhibit_all_warnings!
workspace 'MyApp'
target 'MyAppFree' do
pod 'AppBootstrap/FreeVersion'
end
target 'MyAppPaid' do
pod 'AppBootstrap/PaidVersion'
end
AppBootstrap podspec
Pod::Spec.new do |s|
s.name = 'AppBootstrap'
s.version = '3.18.2'
s.summary = 'iOS App Bootstrap Module.'
s.platforms = { ios: '9.0' }
s.swift_version = '5.0'
s.description = <<-DESC
Contains classes to bootstrap ios apps.
DESC
s.homepage = ---
s.license = { type: 'MIT', file: 'LICENSE' }
s.author = { --- }
s.source = { --- }
s.frameworks = [
'Foundation',
'UIKit'
]
s.subspec 'PaidVersion' do |sub|
sub.dependency 'Advertisement/Core'
sub.source_files = [
'AppBootstrap/source/**/*.swift'
]
sub.resources = [
'AppBootstrap/support/Localization/*.lproj',
'AppBootstrap/support/ConsentText.plist',
'AppBootstrap/support/Images.xcassets'
]
sub.pod_target_xcconfig = {
'APPLICATION_EXTENSION_API_ONLY' => 'NO'
}
sub.pod_target_xcconfig = {
'OTHER_SWIFT_FLAGS' => '-D"PAIDVERSION"'
}
end
s.subspec 'FreeVersion' do |sub|
sub.dependency 'Advertisement/Ads'
sub.source_files = [
'AppBootstrap/source/**/*.swift'
]
sub.resources = [
'AppBootstrap/support/Localization/*.lproj',
'AppBootstrap/support/ConsentText.plist',
'AppBootstrap/support/Images.xcassets',
'AppBootstrap/support/Colors.xcassets',
'AppBootstrap/support/Fonts/*.otf'
]
sub.pod_target_xcconfig = {
'APPLICATION_EXTENSION_API_ONLY' => 'NO'
}
sub.pod_target_xcconfig = {
'OTHER_SWIFT_FLAGS' => '-D"FREEVERSION"'
}
end
s.subspec 'Undefined' do |sub|
sub.dependency 'Advertisement/Core'
sub.source_files = [
'AppBootstrap/source/**/*.swift'
]
sub.resources = [
'AppBootstrap/support/Localization/*.lproj',
'AppBootstrap/support/ConsentText.plist',
'AppBootstrap/support/Images.xcassets',
'AppBootstrap/support/Fonts/*.otf'
]
sub.pod_target_xcconfig = {
'APPLICATION_EXTENSION_API_ONLY' => 'NO'
}
sub.pod_target_xcconfig = {
'OTHER_SWIFT_FLAGS' => '-D"UNDEFINEDVERSION"'
}
end
s.default_subspec = 'Undefined'
end
Any help/advice is greatly appreciated =)
the error is just happen in Pruduct -> Archive.
you can pod install for single target before archive.
source 'custom-pods/link'
source 'https://cdn.cocoapods.org/'
platform :ios, '9.0'
install! 'cocoapods',
:generate_multiple_pod_projects => true,
:incremental_installation => true
use_frameworks!
inhibit_all_warnings!
def MyAppPods (scheme)
if scheme == 'MyAppFree'
pod 'AppBootstrap/FreeVersion'
end
if scheme == 'MyAppPaid'
pod 'AppBootstrap/PaidVersion'
end
end
workspace 'MyApp'
scheme = ENV['scheme']
if scheme
target scheme do
MyAppPods scheme
end
else
target 'MyAppFree' do
MyAppPods 'MyAppFree'
end
target 'MyAppPaid' do
MyAppPods 'MyAppPaid'
end
end
scheme='MyAppFree' pod install
It's happened to me when I bump iOS min version in Podfile but forgot to bump it for frameworks (targets) in Podfile
One simple fix for your case is not using subspec. Instead, create 2 different specs.
e.g
target 'MyAppFree' do
pod 'AppBootstrapFreeVersion'
end
target 'MyAppPaid' do
pod 'AppBootstrapPaidVersion'
end

Multiple Private repo cocoapods spec file

I submite my code to github and creat cocoapods spec filestrong text
Pod::Spec.new do |s|
s.name = "PageSegment"
s.version = "v0.0.1"
s.summary = "A short description of PageSegment."
s.description = <<-DESC
这是一个关于承载多个页面的聚合页,并且可以自定义top栏每个item的样式
DESC
s.homepage = "https://github.com/sunhua163/PageSegment"
s.license = { :type => "MIT", :file => "FILE_LICENSE" }
s.author = { "sunhua" => "sunhua#yizijob.com" }
s.source = { :git => "https://github.com/sunhua163/PageSegment", :tag => s.version.to_s }
s.source_files = "Classes", "PageSegment/PageSegment框架/**/*.{h,m}"
s.exclude_files = "Classes/Exclude"
end
When I do pod spec lint . I get
pod spec lint
-> PageSegment.podspec
- ERROR | spec: The specification defined in `PageSegment.podspec` could not be loaded.
[!] Invalid `PageSegment.podspec` file: Malformed version number string v0.0.1.
# from PageSegment.podspec:19
# -------------------------------------------
#
> s.source = { :git => "https://github.com/sunhua163/PageSegment", :tag => s.version.to_s }
#
# -------------------------------------------
Analyzed 1 podspec.
[!] The spec did not pass validation, due to 1 error.
[!] The validator for Swift projects uses Swift 3.0 by default, if you are using a different version of swift you can use a `.swift-version` file to set the version for your Pod. For example to use Swift 2.3, run:
`echo "2.3" > .swift-version`.
Can anybody please help! Thanks
Just run the following command in the terminal:
`echo "2.3" > .swift-version`
It will create a swift version file in your pod-project folder. And then you can run the lint command to validate your podspec.

pod spec lint: Attempt to read non existent folder

Trying to lint a local pod spec
$ pod spec lint MyPod.podspec
I'm getting
[!] Attempt to read non existent folder /private/tmp/CocoaPods/Lint/Pods/MyPod.
I checked /private/tmp/CocoaPods/Lint/Pods/ where I didn't find my podspec indeed,
but I found it in /private/tmp/CocoaPods/Lint/Pods/Local Podspecs/
What can cause this and/or how can I debug ?
For info here is my pod spec
Pod::Spec.new do |s|
s.name = "MyPod"
s.version = "0.0.1"
s.summary = "A pretty cool pod"
s.author = { "Me" => "me#home.net" }
s.license = 'MIT'
s.homepage = "http://www.mypod.net"
s.source = { :path => "." }
s.source_files = '*.{h,m}'
s.platform = :ios, '6.0'
s.requires_arc = true
end
:path seems to cause the trouble, :git works
In my case it was caused by commented s.source line as I was testing it before with local podspec and sources. When you'll commit your podspec to the repo make sure to run pod repo update
This can also happen if you have not yet pushed your podspec's targeted tags to your origin/repo. I assume the same might also be true if you are targeting a non-existent git, branch, etc.

Resources