Here is my podspec:
Pod::Spec.new do |s|
s.name = "MXMarkdownKeyboard"
s.version = "0.0.3"
s.summary = "MarkdwonKeyboard for iOS"
s.homepage = "https://github.com/mexiQQ/MXMarkdownKeyboard"
s.license = { :type => "MIT", :file => "LICENSE.md" }
s.author = { "mexiqq" => "ljw040426#gmail.com" }
s.platform = :ios
s.source = { :git => "https://github.com/mexiQQ/MXMarkdownKeyboard.git",:tag => '0.0.3'}
s.source_files = "MXMarkdownKeyboard", "MXMarkdownKeyboard/*.{h,m}"
end
The repo is here: https://github.com/mexiQQ/MXMarkdownKeyboard
When I execute pod spec lint it returns:
MXMarkdownKeyboard.podspec passed validation.
But, when I execute pod trunk push I get this error:
[!] The Pod Specification did not pass validation.
How can I fix this and push my spec to trunk?
It's expecting a file called LICENSE in the root of your repo, but it can't find one.
Related
I am trying to install a library through local podspec. This is how my podspec looks like
Pod::Spec.new do |s|
s.name = 'MI_SDK_DEVELOPMENT'
s.version = '1.0.0'
s.license = { :type => 'Unspecified' }
s.homepage = 'https://www.modirum.com'
s.authors = { 'Modirum Ou' => 'info#modirum.com' }
s.summary = 'Modirum 3DS SDK iOS framework (Development)'
s.platform = :ios
s.source = { :path => './LocalPods/MI_SDK_DEVELOPMENT.framework.zip' }
s.ios.deployment_target = '8.0'
s.ios.vendored_frameworks = 'MI_SDK_DEVELOPMENT.framework'
end
when I run the pod install pods installed successfully but it does not copy the 'MI_SDK_DEVELOPMENT.framework' in the XCode project. So I am having the following error
So don't know is there something wrong with the Pod itself or I am missing something in the installation. Any help will be highly appreciated. Thanks
EDIT:
Podfile
# Uncomment the next line to define a global platform for your project
platform :ios, '8.0'
target 'ModirumSDKExample' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for ModirumSDKExample
pod 'MI_SDK_DEVELOPMENT', :path => './LocalPods/MI_SDK_DEVELOPMENT.podspec'
end
By the Cocoapods Documentation, it seems that .zip files are only unarchivable via http resources:
Using HTTP to download a compressed file of the code. It supports zip, tgz, bz2, txz and tar.
So this would work:
s.source = { :http => 'https://example.com/MI_SDK_DEVELOPMENT.framework.zip' }
This would not:
s.source = { :path => './LocalPods/MI_SDK_DEVELOPMENT.framework.zip' }
I want push some code into master pod, this code depend on Protobuf.
s.dependency 'Protobuf', '3.3.0'
I had tried the follow three method to resolve it. But I failed.
# method 1
s.xcconfig = {
# we have a math.h which conflicts with the system math.h unless
# we disable header maps
'GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS' => "1",
}
# method 2
s.compiler_flags = '-GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1'
# method 3
s.pod_target_xcconfig = { 'GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS' => '1' }
The follow is my spec file:
Pod::Spec.new do |s|
s.name = 'KSAdSDK'
s.version = '2.0'
s.summary = 'KSAdSDK.'
# 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.homepage = 'http://xxxx/KSAdSDK'
# s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'xxxxx' }
s.source = { :git => 'http://xxx/KSAdSDK.git', :tag => s.version.to_s }
s.ios.deployment_target = '8.0'
s.requires_arc = false
s.requires_arc = ['xxxx/**/*.m']
s.source_files = 'xxx/**/*'
s.public_header_files = 'xxxx/*.h'
s.frameworks = 'UIKit', 'MobileCoreServices', 'CoreGraphics', 'Security', 'SystemConfiguration', 'CoreTelephony', 'AdSupport', 'CoreData', 'StoreKit'
s.library = "z"
s.dependency 'AFNetworking'
s.dependency 'SDWebImage'
s.dependency 'MJExtension'
s.dependency 'Godzippa'
s.dependency 'Protobuf'
end
I use
pod lib lint --verbose --allow-warnings
and failed.
fatal error: 'google/protobuf/Any.pbobjc.h' file not found
#import "google/protobuf/Any.pbobjc.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Use
s.pod_target_xcconfig = {
'GCC_PREPROCESSOR_DEFINITIONS' =>
'GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1 '
}
Full example at https://github.com/firebase/firebase-ios-sdk/blob/master/FirebaseMessaging.podspec
Here is what I am trying to do:
Installing private pod with vendored_frameworks.
MyFramework.podspec looks like
Pod::Spec.new do |spec|
spec.name = "MyFramework"
spec.summary = "My summary"
spec.version = "1.0.0"
spec.homepage = "https://www.google.com"
spec.authors = { "Me" => "me#gmail.com" }
spec.license = { :type => "MIT", :file => "LICENSE" }
spec.source = { :http => "url to my zip containing the three frameworks" }
spec.platform = :ios, "10.0"
spec.preserve_paths = 'MyFramework1.framework', 'MyFramework2.framework', 'MyFramework3.framework'
spec.ios.vendored_frameworks = 'MyFramework1.framework', 'MyFramework2.framework', 'MyFramework3.framework'
spec.xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => "'${PODS_ROOT}/MyFramework1'"}
spec.frameworks = 'MyFramework1', 'MyFramework2', 'MyFramework3'
end
And my Podfile line looks like
pod 'MyFramework1', :git => 'myUrl.git'
The pod spec lint . is working well and also the pod repo push ....
Unfortunately, the three frameworks are not installed when I'm doing pod install.
However, I discovered that if I change my Podfile with
pod 'MyFramework1', :podspec => '/path/to/podspec'
everything is working fine and I got the three frameworks when I'm doing pod install.
Of course, I checked that the podspec is exactly the same as the one on my repo git.
What should I do to get it working with :git => url?
May be you need to do install_framework command
I am trying to find out a way to declare dependency from subspec 'B' to subspec 'A' in the podspec: 'mypodspecfile.podspec' as below:
Pod::Spec.new do |s|
s.name = "MyLib-SDK"
s.version = "1.0"
s.summary = "My Library"
s.homepage = "http://myhomepage.com"
s.ios.deployment_target = "8.0"
s.ios.frameworks = "Foundation", "UIKit", "SystemConfiguration", "Security", "CoreTelephony", "WebKit"
s.source = { :git => "https://github.com/myhome/ios-project.git", :tag => "1.0" }
s.subspec 'MyLibrary-A' do |libOne|
libOne.source_files = "Headers", "Headers/**/*.h"
libOne.exclude_files = "Headers/Exclude"
libOne.resources = "SharedAssets/*"
libOne.libraries = "z","sqlite3" #Zlib for gzip, sqlite3 for event store
libOne.vendored_library = "libMyLibrary_A.a"
end
s.subspec 'MyLibrary-B' do |libTwo|
libTwo.source_files = "Headers", "Headers/**/*.h"
libTwo.exclude_files = "Headers/Exclude"
libTwo.resources = "SharedAssets/*"
libTwo.dependency 'MyLibrary-A' <-- doesn't seem to be working here!!
libTwo.libraries = "sqlite3" # sqlite3 for db
libTwo.vendored_library = "libMyLibrary_B.a"
end
end
When I execute:
$pod spec lint mypodspecfile.podspec --verbose
-ERROR | [iOS] unknown: Encountered an unknown error (Unable to find a specification for MyLibrary-A depended upon by MyLibrary-B
Any help would be greatly appreciated. Thanks you!
You should always write the full path to the pod dependencies. The error states that cocoa pods cannot find the .podspec file for MyLibrary-A in the pod repo(s). To fix the issue, specify full path 'MyLib-SDK/MyLibrary-A'.
So your podspec file should look like this:
Pod::Spec.new do |s|
s.name = "MyLib-SDK"
s.version = "1.0"
s.summary = "My Library"
s.homepage = "http://myhomepage.com"
s.ios.deployment_target = "8.0"
s.ios.frameworks = "Foundation", "UIKit", "SystemConfiguration", "Security", "CoreTelephony", "WebKit"
s.source = { :git => "https://github.com/myhome/ios-project.git", :tag => "#{s.version}" }
s.subspec 'MyLibrary-A' do |libOne|
libOne.source_files = "Headers", "Headers/**/*.h"
libOne.exclude_files = "Headers/Exclude"
libOne.resources = "SharedAssets/*"
libOne.libraries = "z","sqlite3" #Zlib for gzip, sqlite3 for event store
libOne.vendored_library = "libMyLibrary_A.a"
end
s.subspec 'MyLibrary-B' do |libTwo|
libTwo.source_files = "Headers", "Headers/**/*.h"
libTwo.exclude_files = "Headers/Exclude"
libTwo.resources = "SharedAssets/*"
libTwo.dependency 'MyLib-SDK/MyLibrary-A' # here is the change
libTwo.libraries = "sqlite3" # sqlite3 for db
libTwo.vendored_library = "libMyLibrary_B.a"
end
end
I am trying to send a library to the CocoaPods repo, but it fails the push procedure.
However, it does not fail the lint check as we can see here:
$ pod spec lint GUIPlayerView.podspec
-> GUIPlayerView (0.0.1)
Analyzed 1 podspec.
GUIPlayerView.podspec passed validation.
$ pod trunk push GUIPlayerView.podspec
Validating podspec
-> GUIPlayerView (0.0.1)
[!] The Pod Specification did not pass validation.
There is no error or warning message. My local git repo is synced and up-to-date with the remote's master. What can I do?
Edit: here's the podspec file:
Pod::Spec.new do |s|
s.name = "GUIPlayerView"
s.version = "0.0.1"
s.summary = "GUIPlayerView is a simple video player embedded into a UIView."
s.homepage = "https://github.com/guilhermearaujo/GUIPlayerView"
s.license = { :type => "MIT", :file => "LICENSE" }
s.author = { "Guilherme Araújo" => "me#mail.com" }
s.platform = :ios, "7.0"
s.source = { :git => "https://github.com/guilhermearaujo/GUIPlayerView.git", :tag => "0.0.1" }
s.source_files = "GUIPlayerView/Classes", "Classes/**/*.{h,m}"
s.exclude_files = "GUIPlayerView/Classes/Exclude"
s.resources = "GUIPlayerView/Resources/*.png"
s.framework = "AVFoundation"
end
I learned about the --verbose parameter and reading through the logs I saw that the key s.requires_arc = true was missing.
For some reason, this warning was not shown without the --verbose flag.