Xcode Swift CocoaPods pod spec lint Fails on Embed Pods Frameworks - ios

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.

Related

pod spec lint validation fail : Unable to find matching .xcframework slice for the current build architectures (x86_64 i386)

I already have my framework in cocoapod, using xcframework with several framework inside :
ios-arm64
ios-arm64_x86_64-maccatalyst
ios-arm64_x86_64-simulator
tvos-arm64
tvos-arm64_x86_64-simulator
On my first push, I only put s.ios.deployment_target but forget s.tvos.deployment_target in my podspec. I edit the podspec file (updated s.version old was 1.0.0, new is 1.0.0-tvOS , adding s.tvos.deployment_target), commit and push on github, and create a tag with the same name as the version.
Pod::Spec.new do |s|
s.name = 'projectSwift'
s.version = '1.0.0-tvOS'
s.summary = 'summ'
s.description = 'descri'
s.homepage = 'http://homepage.com'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'author' => 'author#mmmail.com' }
s.source = { :git => 'linktogit', :tag => s.version }
s.vendored_frameworks = "projectSwift.xcframework"
s.ios.deployment_target = '10.2'
s.tvos.deployment_target = '9.0'
s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
end
When I try after to pod spec lint, it fail with this error :
pod spec lint --no-clean
Ignoring ffi-1.13.1 because its extensions are not built. Try: gem pristine ffi --version 1.13.1
-> projectSwift (1.0.0-tvOS)
- ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
- NOTE | xcodebuild: note: Using new build system
- NOTE | xcodebuild: note: Building targets in parallel
- NOTE | xcodebuild: note: Using codesigning identity override: -
- NOTE | [iOS] xcodebuild: note: Planning build
- NOTE | [iOS] xcodebuild: note: Constructing build description
- NOTE | [iOS] xcodebuild: warning: Skipping code signing because the target does not have an Info.plist file and one is not being generated automatically. (in target 'App' from project 'App')
- NOTE | [iOS] xcodebuild: warning: [CP] Unable to find matching .xcframework slice in 'projectSwift/projectSwift.xcframework projectSwift framework ios-arm64 ios-arm64_x86_64-maccatalyst ios-arm64_x86_64-simulator' for the current build architectures (x86_64 i386).
- NOTE | xcodebuild: ld: warning: directory not found for option '-F/Users/adminlocal/Library/Developer/Xcode/DerivedData/App-bmhifwqmbbcfjnftngtmnjgbwkek/Build/Products/Release-iphonesimulator/XCFrameworkIntermediates/projectSwift'
- NOTE | xcodebuild: clang: error: linker command failed with exit code 1 (use -v to see invocation)
Pods workspace available at `/var/folders/_b/5v6y69j55cs0c_3fcw0cf5m80000gp/T/CocoaPods-Lint-20210316-13156-1ipai8f-projectSwift/App.xcworkspace` for inspection.
Analyzed 1 podspec.
[!] The spec did not pass validation, due to 1 error.
I didn't modify anything else than the podspec.

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

pod spec lint or pod lib lint fails while updating cocoapods library

I'm trying to update my GLNotification cocopods version.
I had switched over from Xcode 9.4 -> Xcode 10. I had converted my code to latest swift version, after that i'm unable to update my pods.
But there is no warning or error in my code. It works fine. Download my code here .
My Pods Spec
Pod::Spec.new do |s|
s.name = 'GLNotificationBar'
s.version = '2.3.6'
s.summary = 'GLNotificationBar lets user to handle push notification when app is active.'
s.description = <<-DESC
GLNotificationBar is a open source library that lets developers to display push notification or any alert message to end user as banner. iOS below 10 does't displays notification when app is active. This library is inspired by Apple's ios10 notification bar.
DESC
s.homepage = 'https://github.com/gokulgovind/GLNotificationBar'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'gokul' => 'gokulece26#gmail.com' }
s.source = { :git => 'https://github.com/gokulgovind/GLNotificationBar.git', :tag => s.version.to_s }
s.ios.deployment_target = '10.0'
s.source_files = 'GLNotificationBar/Classes/**/*'
s.resource_bundles = {
'GLNotificationBar' => ['GLNotificationBar/Classes/*.xib','GLNotificationBar/Assets/*.png']
}
s.frameworks = 'UIKit'
end
Error
-> GLNotificationBar (2.3.6)
- ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
- ERROR | xcodebuild: GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:247:59: error: type 'UIWindow' has no member 'Level'
- ERROR | xcodebuild: GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:278:44: error: type 'NSAttributedString' has no member 'Key'
- ERROR | xcodebuild: GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:323:69: error: type 'UIWindow' has no member 'Level'
- ERROR | xcodebuild: GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:419:115: error: type 'UIResponder' has no member 'keyboardWillShowNotification'
- ERROR | xcodebuild: GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:420:114: error: type 'UIResponder' has no member 'keyboardWillHideNotification'
- ERROR | xcodebuild: GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:486:44: error: type 'NSAttributedString' has no member 'Key'
- ERROR | xcodebuild: GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:487:44: error: type 'NSAttributedString' has no member 'Key'
- ERROR | xcodebuild: GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:489:44: error: type 'NSAttributedString' has no member 'Key'
- ERROR | xcodebuild: GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:527:64: error: type 'UIControl' has no member 'State'
- NOTE | xcodebuild: UIKit.UIControl:16:14: note: did you mean 'state'?
- ERROR | xcodebuild: GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:528:90: error: type 'UIControl' has no member 'Event'
- ERROR | xcodebuild: GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:744:55: error: type 'UIWindow' has no member 'Level'
- ERROR | xcodebuild: GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:813:80: error: type 'UIView' has no member 'AnimationOptions'
- ERROR | xcodebuild: GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:916:33: error: type 'UITextField' has no member 'BorderStyle'
- ERROR | xcodebuild: GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:920:38: error: type 'UIControl' has no member 'State'
- ERROR | xcodebuild: GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:922:67: error: type 'UIControl' has no member 'State'
- ERROR | xcodebuild: GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:990:47: error: type 'UIWindow' has no member 'Level'
- ERROR | xcodebuild: GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:1005:43: error: type 'UIResponder' has no member 'keyboardFrameEndUserInfoKey'
- ERROR | xcodebuild: GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:1018:43: error: type 'UIResponder' has no member 'keyboardFrameEndUserInfoKey'
- ERROR | xcodebuild: GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:1123:27: error: type 'NSAttributedString' has no member 'Key'
- ERROR | xcodebuild: GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:1132:27: error: type 'NSAttributedString' has no member 'Key'
Fix I Tried
Added s.swift_version = '4.1' in my GLNotificationBar.podspec
Changed Swift Language Version to 4.2 in Build Settings
Updated iOS deployment target from iOS 8 to iOS 10
Terminal Command I Tried
pod spec lint GLNotificationBar.podspec
pod spec lint
pod spec lint --allow-warnings
Have you tried updating the Swift language version in your pod spec?
It might be a compilation issue for mismatched language versions.
This is your latest commit and it's still set to an earlier version of Swift than the project settings.
As you moved to X-Code 10, it supports swift 4 and 4.2 as of now, so you need to have same in build settings as well as in Pods Spec.
If you are not using swift 3,4 and 4.2 then need to go to File->Workspace Setting
and select build system to Legacy Build System.
You need to commit everything and push to git.
Update tag to new version and push to tag.
Then try to push to Cocoapods pod trunk push --allow-warnings.
Let me know if you get any issues after you try this.
Thanks.

Where storyboards should be included in a pod project?

I'm trying to generated a Pod with some graphics into a storyboard.
Well, my issue is the next.
When I try to run
pod spec lint --verbose
I get the next error:
The following build commands failed:
ComipileStoryboard MyProject/Example/Base.lproj/Main.storyboard
- ERRRO | [iOS] xcodebuild: Returned an unsuccessful exit code.
Where I should add the storyboards files?
Anything other than source files will go in resources or resource-bundles
Pod::Spec.new do |spec|
spec.name = 'YOUR_LIB_NAME'
spec.version = '1.0'
spec.source_files = 'YOUR_LIB_NAME/*'
spec.resource_bundles = {
'YOUR_LIB_NAME' => ['YOUR_LIB_NAME/YOUR_PATH_TO_STORYBOARD/*.storyboard']
}
end

Error using Apple frameworks in my CocoaPod podspec?

I have a cross platform library that I'm trying to push to CocoaPod, but the it is failing on the podspec validation. The error I get is:
ERROR | xcodebuild: Returned an unsuccessful exit code. You can use --verbose for more information.
ERROR | xcodebuild: MyPod/Sources/CLKComplicationServer.swift:10:8: error: no such module 'ClockKit'
I tried adding the frameworks to my podspec, but it is still not accepting. Here is what my podspec looks like:
Pod::Spec.new do |s|
...
s.ios.deployment_target = "8.4"
s.watchos.deployment_target = "2.0"
s.tvos.deployment_target = "9.0"
s.requires_arc = true
s.ios.framework = 'AVFoundation'
s.watchos.framework = 'ClockKit'
s.source_files = "Sources/**/*.{h,swift}"
end
What am I doing wrong? I'm having the same issue with AVFoundation. I tried adding both to my header file, but ClockKit is not recognized.

Resources