question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support Swift pods

See original GitHub issue

When I pass RxSwift to the script, it failed with logs below,

=== BUILD TARGET RxSwift OF PROJECT Pods WITH CONFIGURATION Release ===

Check dependencies
The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor.

** ARCHIVE FAILED **


The following build commands failed:
	Check dependencies
(1 failure)
The pods combined add an extra size of -51492 bytes

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
pollinicommented, Oct 12, 2018

Unfortunately, that’s not working for me - in fact, the tool is not working anymore at all with the newest commit (16e022a), no matter if trying for Obj-C or Swift Pods. Anyone else experiencing this problem, or is it just on my side?

I think it can be broken down to the following issues according to the logs:

  • e.g. for AFNetworking (and other Obj-C Pods) (called with ./measure_cocoapod_size.py --cocoapods AFNetworking [--mode objc]):
...
/var/folders/k_/g8z_4fdj79n0ngb_270tcbl80000gn/T/tmpGFO4Pr/sizetestproject/Pods/Target Support Files/Pods-SizeTest/Pods-SizeTest-frameworks.sh: line 104: EXPANDED_CODE_SIGN_IDENTITY: unbound variable
Command PhaseScriptExecution failed with a nonzero exit code

...

** ARCHIVE FAILED **

The following build commands failed:
	PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/xxx/Library/Developer/Xcode/DerivedData/SizeTest-gysxpaegtdsfovbnelkxqiryttlb/Build/Intermediates.noindex/ArchiveIntermediates/SizeTest/IntermediateBuildFilesPath/SizeTest.build/Release-iphoneos/SizeTest.build/Script-721CCCD9C8C383FD44E1354F.sh
(1 failure)
The pods combined add an extra size of -51493 bytes
  • e.g. for RxSwift (and other Swift Pods) (called with ./measure_cocoapod_size.py --cocoapods RxSwift --mode swift):
...
/var/folders/k_/g8z_4fdj79n0ngb_270tcbl80000gn/T/tmpbrLTu_/SwiftApp/SwiftApp/AppDelegate.swift:23:96: error: 'UIApplicationLaunchOptionsKey' has been renamed to 'UIApplication.LaunchOptionsKey'
  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
                                                                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                               UIApplication.LaunchOptionsKey
UIKit.UIApplicationLaunchOptionsKey:2:18: note: 'UIApplicationLaunchOptionsKey' was obsoleted in Swift 4.2
public typealias UIApplicationLaunchOptionsKey = UIApplication.LaunchOptionsKey
                 ^
/var/folders/k_/g8z_4fdj79n0ngb_270tcbl80000gn/T/tmpbrLTu_/SwiftApp/SwiftApp/AppDelegate.swift:23:8: warning: instance method 'application(_:didFinishLaunchingWithOptions:)' nearly matches optional requirement 'application(_:didFinishLaunchingWithOptions:)' of protocol 'UIApplicationDelegate'
  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
       ^
/var/folders/k_/g8z_4fdj79n0ngb_270tcbl80000gn/T/tmpbrLTu_/SwiftApp/SwiftApp/AppDelegate.swift:23:8: note: move 'application(_:didFinishLaunchingWithOptions:)' to an extension to silence this warning
  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
       ^
/var/folders/k_/g8z_4fdj79n0ngb_270tcbl80000gn/T/tmpbrLTu_/SwiftApp/SwiftApp/AppDelegate.swift:23:8: note: make 'application(_:didFinishLaunchingWithOptions:)' private to silence this warning
  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
       ^
  private 
UIKit.UIApplicationDelegate:7:26: note: requirement 'application(_:didFinishLaunchingWithOptions:)' declared here
    optional public func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool
                         ^

** ARCHIVE FAILED **


The following build commands failed:
	CompileSwift normal arm64
	CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(2 failures)
The pods combined add an extra size of 0 bytes

Any suggestions? 😬

0reactions
pollinicommented, Oct 16, 2018

So eventually, I got above issues for Xcode 10 and Swift 4.2 fixed - namely by the following approaches:

  • Updating CocoaPods to a version >= 1.6.0 (at the moment of writing it’s version 1.6.0.beta.1) - Thanks for pointing me in the right direction @davidair !
  • Converting respective Swift code to version 4.2 syntax and setting version 4.2 as the (default) language version in the build settings of the (Swift) project
Read more comments on GitHub >

github_iconTop Results From Across the Web

CocoaPods
CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects. It has over 93 thousand libraries and is used in over 3...
Read more >
CocoaPods Tutorial for Swift: Getting Started
Use this CocoaPods Tutorial for Swift to learn how to install and manage third-party library dependencies in your Swift projects.
Read more >
CocoaPods Tutorial using Swift and Xcode - CodeWithChris
Learn how to install and use Cocoapods in your Xcode project! Take advantage of third party Swift libraries and GitHub repositories easily.
Read more >
Supporting Both CocoaPods & The Swift Package Manager
A step-by-step guide to set up your Xcode project to support both CocoaPods and the Swift Package Manager with your iOS library.
Read more >
Top 50 Active Swift CocoaPods For iOS [Updated Dec 2020]
Top Swift CocoaPods Ranked · #11 Moya · #12 CocoaLumberjack · #13 Material · #14 Eureka · #15 SkeletonView · #16 NVActivityIndicatorView ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found