Git Product home page Git Product logo

Comments (13)

pollini avatar pollini commented on May 2, 2024 1

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? 😬

from cocoapods-size.

VinayGuthal avatar VinayGuthal commented on May 2, 2024

We probably need a way to pass in SWIFT_VERSION to the script so that we can use this setting while actually building. Assigning this to myself

from cocoapods-size.

paulb777 avatar paulb777 commented on May 2, 2024

Hmm, that doesn't seem necessary. How does pod lib lint build the pod?

from cocoapods-size.

davidair avatar davidair commented on May 2, 2024

One can probably just always set SWIFT_VERSION based on the output of "xcrun swift -version"

from cocoapods-size.

pollini avatar pollini commented on May 2, 2024

great tool, really appreciating your work and effort! but - any news on this issue?

from cocoapods-size.

VinayGuthal avatar VinayGuthal commented on May 2, 2024

Fixed by #7.. Use --mode swift to make it work for swift pods. Will update the read me

from cocoapods-size.

VinayGuthal avatar VinayGuthal commented on May 2, 2024

I will have a look

from cocoapods-size.

VinayGuthal avatar VinayGuthal commented on May 2, 2024

Hey, I am unable to reproduce your issue. Can you check the xcode version you have installed by trying xcode-select --print-path? Also which version of swift do you have?

from cocoapods-size.

pollini avatar pollini commented on May 2, 2024

Xcode Version is 10.0
Swift Version is 4.2
xcode-select --print-path gives me /Applications/Xcode.app/Contents/Developer

from cocoapods-size.

pollini avatar pollini commented on May 2, 2024

@VinayGuthal Looking into your code, I suppose you're not on the latest Xcode & Swift version which causes the problems?

from cocoapods-size.

davidair avatar davidair commented on May 2, 2024

I tried both ObjC and Swift using Xcode 9 and Xcode 10.

For Xcode 9, both ObjC and Swift work for me.
For Xcode 10, ObjC works but not Swift.

from cocoapods-size.

davidair avatar davidair commented on May 2, 2024

@pollini : Which exact version of Xcode 10 do you have? There was a known issue with the ObjC problem you have reported: CocoaPods/CocoaPods#8089

from cocoapods-size.

pollini avatar pollini commented on May 2, 2024

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

from cocoapods-size.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.