Cocoapods installing SwiftAA for iOS and watchOS but not macOS Catalyst

53 views
Skip to first unread message

אהרן אדלמן

unread,
Aug 16, 2021, 8:30:09 AM8/16/21
to CocoaPods
Hello.

I posted this yesterday on StackOverflow (https://stackoverflow.com/questions/68792786/cocoapods-installing-swiftaa-for-ios-and-watchos-but-not-macos-catalyst?noredirect=1#comment121577017_68792786), but not getting a useful there, posting here seemed a logical option.

What I am trying to do: I am writing a date and time program (“Date-O-Rama”) for iOS, macOS, and watchOS. (Apple has been getting much nicer about running the same code on different platforms with little or no alterations.) I need more astronomical information, so I decided to add the package SwiftAA (https://github.com/onekiloparsec/SwiftAA).

What actually happens: The best I have managed to do is to get Cocoapods to install SwiftAA for iOS and watchOS, and the code runs on both platforms, including in unit tests. (And it correctly calculates Moon phases, there, too.) However, the macOS (specifically, Mac Catalyst) version of SwiftAA fails to build. Attempting to use it on macOS results in a message of "No such module ‘SwiftAA’” in code. On disk (see picture), it is clear that Xcode has built iOS and watchOS versions of SwiftAA and a related framework it depends on, ObjCAA, but it never builds them for Mac Catalyst.

Environment: I am programming in Xcode 12.5.1 on my M1 MacBook Pro running macOS Big Sur 11.5.2. Cocoapods is 1.10.2.

SwiftAA: I am working with version 2.3.0.

Podfile:

# Uncomment the next line to define a global platform for your project
#platform :ios, '14.0'

target 'Date-O-Rama' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for Date-O-Rama
platform :ios, '14.0'
  pod 'SwiftAA'

  target 'Date-O-RamaTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'Date-O-RamaUITests' do
    # Pods for testing
  end

end

target 'WatchDate-O-Rama' do
  platform :watchos, '7.0'
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for WatchDate-O-Rama

end

target 'WatchDate-O-Rama Extension' do
platform :watchos, '7.0'
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for WatchDate-O-Rama Extension
  pod 'SwiftAA'

end

I feel very confused in that there seems to be nothing in my project that indicates that iOS and Mac Catalyst should be treated any differently, but clearly that is what Xcode is doing. Does anyone have any idea what might be possibly going wrong and how to fix it? Thanks in advance.

Aaron Adelman

Reply all
Reply to author
Forward
0 new messages