mixpanel / mixpanel-iphone

Official iOS (Objective-C) Tracking Library for Mixpanel Analytics
http://mixpanel.com
Apache License 2.0
1.05k stars 567 forks source link

Cannot build using Carthage on Xcode 14 beta 5 - schema confusion #997

Closed m-keller closed 1 year ago

m-keller commented 2 years ago

Integration Method: Carthage Xcode Version: Xcode 14 beta 5 Library Version: 4.2.0 Platform: iOS Language: Swift Description:

Carthage correctly builds the iOS target when using Xcode 13. However, on Xcode 14 beta Carthage somehow only finds the "App Extension" schema as the only appropriate build target and that ends here:

A shell task (/usr/bin/xcrun xcodebuild -project /Users/REDACTED/ios/Carthage/Checkouts/mixpanel-iphone/Mixpanel.xcodeproj -scheme [App\ Extension]\ Mixpanel -configuration Release CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -showBuildSettings -skipUnavailableActions) failed with exit code 6:
2022-08-12 10:46:48.429 xcodebuild[93169:3580009] [MT] DVTAssertions: ASSERTION FAILURE in /System/Volumes/Data/SWE/Apps/DT/BuildRoots/BuildRoot8/ActiveBuildRoot/Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-21330/IDEFoundation/Execution/RunDestinations/IDERunDestinationCLI.m:566
Details:  Unhandled/unexpected case where no run destinations were produced.
Object:   <IDERunDestinationCLI>
Method:   +resolveRunDestinationsWithWorkspace:scheme:buildAction:schemeCommand:schemeTask:destinationSpecifications:architectures:timeout:runDestinationManager:deviceManager:fallbackPreferredSDK:fallbackPreferredArchitectures:skipUnsupportedDestinations:shouldSkipRunDestinationValidation:didDisambiguate:disambiguatedMatches:disambiguatedMatchesDescription:error:
Thread:   <_NSMainThread: 0x6000033b0400>{number = 1, name = main}
Hints: 

Backtrace:
  0   -[DVTAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in DVTFoundation)
  1   _DVTAssertionHandler (in DVTFoundation)
  2   _DVTAssertionFailureHandler (in DVTFoundation)
  3   +[IDERunDestinationCLI resolveRunDestinationsWithWorkspace:scheme:buildAction:schemeCommand:schemeTask:destinationSpecifications:architectures:timeout:runDestinationManager:deviceManager:fallbackPreferredSDK:fallbackPreferredArchitectures:skipUnsupportedDestinations:shouldSkipRunDestinationValidation:didDisambiguate:disambiguatedMatches:disambiguatedMatchesDescription:error:] (in IDEFoundation)
  4   -[Xcode3CommandLineBuildTool _resolveRunDestinationsForBuildAction:] (in Xcode3Core)
  5   -[Xcode3CommandLineBuildTool _resolveInputOptionsWithTimingSection:] (in Xcode3Core)
  6   -[Xcode3CommandLineBuildTool run] (in Xcode3Core)
  7   XcodeBuildMain (in libxcodebuildLoader.dylib)
  8   start (in dyld)

I ran a small comparison of the output of xcodebuild -showBuildSettings and there are a few concerning changed (lines with - in front belong to Xcode 14 Beta):

-    VALID_ARCHS = arm64
+    VALIDATE_WORKSPACE = NO
+    VALID_ARCHS = arm64 armv7
-    PLATFORM_PREFERRED_ARCH = undefined_arch
-    PLATFORM_PRODUCT_BUILD_VERSION = 20A5339d
+    PLATFORM_PREFERRED_ARCH = arm64
+    PLATFORM_PRODUCT_BUILD_VERSION = 19F64

Expected Behavior:

Carthage should build the iOS target of mixpanel-iphone.

csaper commented 1 year ago

I can confirm this issue with Xcode 14.1 and the Mixpanel v5.0.0 library.

Integration Method: Carthage Xcode Version: Xcode 14.1 Library Version: 5.0.0 Platform: iOS Language: Objective-C

Once in the main directory, I run the following command line argument carthage build --platform iOS --no-skip-current --use-xcframeworks and the Carthage compilation appears to fail with the following error:

A shell task (/usr/bin/xcrun xcodebuild -project /Users/USER/development/mixpanel-iphone-5.0.0/Mixpanel.xcodeproj -scheme [App\ Extension]\ Mixpanel -configuration Release CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -showBuildSettings -skipUnavailableActions) failed with exit code 6:
2022-11-07 11:40:33.136 xcodebuild[53430:1177183] [MT] DVTAssertions: ASSERTION FAILURE in /System/Volumes/Data/SWE/Apps/DT/BuildRoots/BuildRoot1/ActiveBuildRoot/Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-21534.1/IDEFoundation/Execution/RunDestinations/IDERunDestinationCLI.m:566
Details:  Unhandled/unexpected case where no run destinations were produced.
Object:   <IDERunDestinationCLI>
Method:   +resolveRunDestinationsWithWorkspace:scheme:buildAction:schemeCommand:schemeTask:destinationSpecifications:architectures:timeout:runDestinationManager:deviceManager:fallbackPreferredSDK:fallbackPreferredArchitectures:skipUnsupportedDestinations:shouldSkipRunDestinationValidation:didDisambiguate:disambiguatedMatches:disambiguatedMatchesDescription:error:
Thread:   <_NSMainThread: 0x600000184240>{number = 1, name = main}
Hints:

Backtrace:
  0   -[DVTAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in DVTFoundation)
  1   _DVTAssertionHandler (in DVTFoundation)
  2   _DVTAssertionFailureHandler (in DVTFoundation)
  3   _sortDevicesForDisplay (in IDEFoundation)
  4   -[Xcode3CommandLineBuildTool _resolveRunDestinationsForBuildAction:] (in Xcode3Core)
  5   -[Xcode3CommandLineBuildTool _resolveInputOptionsWithTimingSection:] (in Xcode3Core)
  6   -[Xcode3CommandLineBuildTool run] (in Xcode3Core)
  7   XcodeBuildMain (in libxcodebuildLoader.dylib)
  8   start (in dyld)

It appears that Carthage is indeed only locating the Xcode project scheme [App Extension] Mixpanel, and not the [iOS] Mixpanel xcscheme.

jaredmixpanel commented 1 year ago

@m-keller @csaper This is fixed in v5.0.1. The Carthage builds attached to the Releases are fixed (and changed to XCFrameworks). You can see the Carthage command we use here: https://github.com/mixpanel/mixpanel-iphone/blob/master/scripts/carthage.sh#L2