Pod spec lint error due to CocoaLumberjack subspec - ios

Week ago I've pushed MyApp to my private cocoapods without any problems. I did not update anything with CocoaLumberjack in the meantime.
My podspec contains:
spec.subspec 'Core' do |cs|
cs.dependency 'libextobjc', '~> 0.4'
cs.dependency 'CocoaLumberjack', '2.0.0-rc2'
end
And here is the command && error:
$ pod repo push my-private MyApp.podspec
Validating spec
-> MyApp (0.0.7)
- NOTE | [MyApp/Core] [xcodebuild] CocoaLumberjack/Classes/DDASLLogger.m:85:31: warning: implicit declaration of function 'geteuid' is invalid in C99 [-Wimplicit-function-declaration]
- ERROR | [MyApp/Core] [xcodebuild] CocoaLumberjack/Classes/DDASLLogger.m:85:31: error: conflicting types for 'geteuid'
- NOTE | [MyApp/Core] [xcodebuild] /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/unistd.h:445:8: note: previous declaration is here
[!] The `MyApp.podspec` specification does not validate.
Where line 85 of that file is:
uid_t const readUID = geteuid();
It has been working before. I have no idea what have changed that it isn't working now.

Seems to fix itself after upgrading to Cocoapods version 0.36.0

Related

validate fail when pushing AFNetworking to private cocoapods podspec

I'm trying to add AFNetworking to the private cocoapods spec by following steps.
clone AFNetworking from github and push to private gitlab
modify AFNetworking.podspec file and change the s.source attribute to the private url
run pod spec lint --verbose, fail with
** BUILD SUCCEEDED **
Testing with xcodebuild. -> AFNetworking (3.2.1)
NOTE | [AFNetworking/Serialization, AFNetworking/Security, AFNetworking/Reachability, and more...] xcodebuild: note: Using new
build system
NOTE | [AFNetworking/Serialization, AFNetworking/Security, AFNetworking/Reachability, and more...] xcodebuild: note: Planning
build
NOTE | [AFNetworking/Serialization, AFNetworking/Security, AFNetworking/Reachability, and more...] xcodebuild: note:
Constructing build description
NOTE | [AFNetworking/Serialization, AFNetworking/Security, AFNetworking/Reachability, and more...] xcodebuild: warning: Skipping
code signing because the target does not have an Info.plist file. (in
target 'App')
ERROR | [AFNetworking/Serialization, AFNetworking/Security, AFNetworking/Reachability, and more...] xcodebuild: Returned an
unsuccessful exit code.
Analyzed 1 podspec.
[!] The spec did not pass validation, due to 1 error.
any guys know how to solve this issue?
Add AFNetworking pod name in your podspec file in dependency section.
s.dependency = 'AFNetworking, :path => ''
Solved my problem by running:
pod repo push MySpec AFNetworking.podspec --sources=MySpec,master --allow-warnings

Xcode Swift CocoaPods pod spec lint Fails on Embed Pods Frameworks

I'm getting the following error when trying to run pod spec lint --verbose:
sent 1312397 bytes received 106 bytes 2625006.00 bytes/sec
total size is 1311832 speedup is 1.00
/var/folders/3d/v0m_90ty4mg1opbynpnjjvzh2010gm/T/CocoaPods-Lint-20181015-62030-oljqd-MySwiftPackage/Pods/Target Support Files/Pods-App/Pods-App-frameworks.sh: line 104: EXPANDED_CODE_SIGN_IDENTITY: unbound variable
Command PhaseScriptExecution failed with a nonzero exit code
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/myuser/Library/Developer/Xcode/DerivedData/App-loplmnuztwibrzfqgadqoxucytrz/Build/Intermediates.noindex/App.build/Release/App.build/Script-09EB8340PON5K18DNW0C63DQ.sh
(1 failure)
Testing with `xcodebuild`.
-> MySwiftPackage (0.1.0)
- WARN | summary: The summary is not meaningful.
- WARN | description: The description is shorter than the summary.
- WARN | url: The URL (https://github.com/fishcharlie/MySwiftPackage) is not reachable.
- NOTE | xcodebuild: note: Using new build system
- NOTE | xcodebuild: note: Planning build
- NOTE | xcodebuild: note: Constructing build description
- NOTE | [iOS] xcodebuild: warning: Skipping code signing because the target does not have an Info.plist file. (in target 'App')
- WARN | xcodebuild: MySwiftPackage/MySwiftPackage/ViewControllers/Shared/MyFirstViewController.swift:102:37: warning: conditional cast from 'UIViewController' to 'MyViewController' (aka 'UIViewController') always succeeds
- WARN | xcodebuild: MySwiftPackage/MySwiftPackage/ViewControllers/Shared/MySecondViewController.swift:145:37: warning: conditional cast from 'UIViewController' to 'MyViewController' (aka 'UIViewController') always succeeds
- ERROR | [OSX] xcodebuild: Returned an unsuccessful exit code.
Analyzed 1 podspec.
[!] The spec did not pass validation, due to 1 error and 5 warnings.
I know I have a few warnings that I can clean up. But there is only one error that I'm getting, which is - ERROR | [OSX] xcodebuild: Returned an unsuccessful exit code.. And above that it says that Embed Pods Frameworks was the cause of failure.
Not quire sure how to debug this since I can build and run the example projects in Xcode just fine.
Below I have attached my Podspec as well.
Pod::Spec.new do |s|
s.name = 'MySwiftPackage'
s.version = '0.1.0'
s.summary = 'A short description of MySwiftPackage.'
s.description = <<-DESC
TODO: Add long description of the pod here.
DESC
s.homepage = 'https://github.com/fishcharlie/MySwiftPackage'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'fishcharlie' => 'fishcharlie.code#gmail.com' }
s.source = { :git => 'https://github.com/fishcharlie/MySwiftPackage.git', :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/char_fish'
s.ios.deployment_target = '9.0'
s.osx.deployment_target = '10.11'
s.swift_version = '4.2'
s.source_files = 'MySwiftPackage/Classes/**/*', 'MySwiftPackage/ViewControllers/Shared/**/*'
s.ios.source_files = 'MySwiftPackage/ViewControllers/iOS/**/*'
s.osx.source_files = 'MySwiftPackage/ViewControllers/macOS/**/*'
s.resources = 'MySwiftPackage/Assets/**/*.{ttf,xcassets}'
s.dependency 'Alamofire', '4.7.3'
s.dependency 'Bond', '6.10.2'
s.ios.dependency '1PasswordExtension', '1.8.5'
end
Any ideas on how to fix/debug this?
The error should be about
line 104: EXPANDED_CODE_SIGN_IDENTITY: unbound variable
The solution (as stated in Issue 7708 on github/Cocoapods ) should be to add the following User-Defined Settings to project:
EXPANDED_CODE_SIGN_IDENTITY="-"
EXPANDED_CODE_SIGN_IDENTITY_NAME="-"`
Try adding the flag --no-clean. This flag makes lint leave the build directory
intact for inspection
so you can debug that build failure in a workspace which may be more familiar and give you more information.
Looks like they fixed this for xcode 10 in pr github.com/CocoaPods/CocoaPods/pull/7720, you could try upgrading to 1.6.0, or downgrading xcode to 9.4.

XMPPFramework in podspec

Previously, I integrated XMPPFramework by using dependencies in podspec: s.dependency 'XMPPFramework', '3.6.6'
I'm aware that in order to fix the error of 'Redefinition of module dnssd'. We should pod directly from the master branch:
pod 'XMPPFramework', :git => "https://github.com/robbiehanson/XMPPFramework.git", :branch => 'master'
Unfortunately, we cannot use dependencies without version, so I commented the dependency out and used pull XMPPFramework using podfile. I fixed some minor issues and was able to build the app, but when I tried to do pod spec lint I got the following error:
- NOTE | xcodebuild: PHMessaging/PHMessaging/Classes/PHMessagingManager.h:20:9: fatal error: 'XMPP.h' file not found - NOTE | xcodebuild: PHMessaging/PHMessaging/Classes/PHBasicConversationViewController.h:10:9: fatal error: 'XMPPFramework/XMPPUser.h' file not found
I've already raised the issue with CocoaPods on GitHub, and #BenAsher44 suggested to create a private specs repo and add it to the dependencies in my podspec. This didn't seem to work. Are there any other ways?

Creating CocoaPod, get error I can't solve about missing file (that is there)

I am trying to create a pod (first one) for this project:
https://github.com/xeppen/GLLingoManager
I run $ pod spec lint GLLingoManager.podspec and I get an error.
-> GLLingoManager (0.1.0)
- ERROR | xcodebuild: Returned an unsuccessful exit code.
- NOTE | xcodebuild: GLLingoManager/Classes/GLLingoManager.m:10:9: fatal error: 'GLNetworkService.h' file not found
I am checking the files and all seem correct. Demo project works etc.
How can I solve this? I dont understand why it says its wrong.
If you use SDK, I think you need to create subspec and specify search paths for each of the SDK may giving issues, for example :
s.subspec "Kairos" do |ss|
ss.dependency "Kairos", "~> 2.1"
ss.xcconfig = { "FRAMEWORK_SEARCH_PATHS" => "$(PODS_ROOT)/Heyzap"}
end

CocoaPods podspec lint failure - file not found

I'm trying to distribute my pod, but I'm having issues with it's validation.
When I'm trying to lint against my .podspec I'm getting:
- ERROR | [iOS] [xcodebuild] path/to/my/source/file.m:14:9: fatal error: 'KeyValueObjectMapping/DCKeyValueObjectMapping.h' file not found
I tried to preserve the path to their framework with different variations like
s.preserve_paths = 'KeyValueObjectMapping.framework/*'
or
s.preserve_paths = '${PODS_ROOT}/Vendor/KeyValueObjectMapping/KeyValueObjectMapping.framework'
& other variations but that way I'm getting one more error:
- ERROR | [iOS] The `preserve_paths` pattern did not match any file.
I also tried different other things which I saw on other issues like:
s.xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/Vendor/KeyValueObjectMapping/KeyValueObjectMapping.framework"','FRAMEWORK_SEARCH_PATHS' => '"$(PODS_ROOT)/Vendor/KeyValueObjectMapping/*"' }
s.framework = 'KeyValueObjectMapping'
The project builds fine with Xcode5 & with xcodebuild with it's default setup, I'm getting this issue only when validating it for Cocoapods.
I was running into this issue trying to create a custom Podspec and add the RevMob and Heyzap SDKs as dependencies.
I kept getting the following error:
- ERROR | [iOS] [xcodebuild] MyProject/MyProjectSubDir/AnotherDir/CustomAd.h:10:9: fatal error: 'RevMobAds/RevMobAds.h' file not found
- ERROR | [iOS] [xcodebuild] MyProject/MyProjectSubDir/AnotherDir/FacebookController.m:18:9: fatal error: 'RevMobAds/RevMobAds.h' file not found
Then when I specified the FRAMEWORK_SEARCH_PATHS for RevMob, I would get the same error but for Heyzap's SDK.
The solution for me was to create a subspec and specify search paths for each of the SDKs giving me issues. Here:
s.subspec "Heyzap" do |ss|
ss.dependency "Heyzap", "~> 6.4.4"
ss.xcconfig = { "FRAMEWORK_SEARCH_PATHS" => "$(PODS_ROOT)/Heyzap"}
end
s.subspec "RevMob" do |ss|
ss.dependency "RevMob", "~> 7.4.8"
ss.xcconfig = { "FRAMEWORK_SEARCH_PATHS" => "$(PODS_ROOT)/RevMob"}
end
My pod spec lint now runs & builds without error.

Resources