Closed soumyamahunt closed 1 year ago
I'm also getting an error when I run pod trunk push
on the current main
branch of BartyCrouch to release 4.12.0, here's the full output:
pod trunk push
[!] Found podspec `BartyCrouch.podspec`
Updating spec repo `trunk`
Validating podspec
nil versions are discouraged and will be deprecated in Rubygems 4
-> BartyCrouch (4.12.0)
- NOTE | xcodebuild: note: Using codesigning identity override:
- NOTE | xcodebuild: note: Building targets in dependency order
- NOTE | [OSX] xcodebuild: Pods.xcodeproj: warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.6, but the range of supported deployment target versions is 10.9 to 12.3.99. (in target 'Pods-App' from project 'Pods')
- NOTE | [OSX] xcodebuild: Pods.xcodeproj: warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.6, but the range of supported deployment target versions is 10.9 to 12.3.99. (in target 'BartyCrouch' from project 'Pods')
- NOTE | xcodebuild: note: Using codesigning identity override: -
- NOTE | [iOS] xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'Pods-App' from project 'Pods')
- NOTE | [iOS] xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'BartyCrouch' from project 'Pods')
- NOTE | [iOS] xcodebuild: /var/folders/n_/vfzcwr7j3gndx375gg3pf9600000gn/T/CocoaPods-Lint-20220925-3947-snqta7-BartyCrouch/App.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'App' from project 'App')
- NOTE | [tvOS] xcodebuild: Pods.xcodeproj: warning: The tvOS Simulator deployment target 'TVOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'Pods-App' from project 'Pods')
- NOTE | [tvOS] xcodebuild: Pods.xcodeproj: warning: The tvOS Simulator deployment target 'TVOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'BartyCrouch' from project 'Pods')
- ERROR | [watchOS] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
- NOTE | [watchOS] xcodebuild: xcodebuild: error: Unable to find a destination matching the provided destination specifier:
[!] The spec did not pass validation, due to 1 error.
I'm using Xcode 14.0.1 and I have all platform SDKs installed (including watchOS). I'm on CocoaPods 1.11.3.
According to man xcodebuild
you can't specify id=
for watch simulators:
A watchOS app is always built and deployed nested inside of an iOS app. To use a watchOS device as your destination, specify a scheme which is configured to run a WatchKit app, and specify the iOS platform destination that is paired with the watchOS device you want to use.
So even though the device id is listed, it can't be used by xcodebuild
.
Executing xcodebuild
manually, without the id parameter, does indeed build OK. A simple fix would therefore be to skip the id
parameter when linting watchOS (or pick the paired iOS one–I haven't tried that)
I managed to fix error: Unable to find a destination matching the provided destination specifier:
error by removing all unpaired watchOS simulators. Here's a script that does that:
xcrun simctl list --json > simulators.json
watch_os_udids=$(jq '.devices[] | map(select(.name | contains("Watch"))) | .[].udid' simulators.json -r)
paired_watch_udids=$(jq '.pairs | map(.watch) | .[].udid' simulators.json -r)
while IFS= read -r udid; do
if [[ ! "${paired_watch_udids[*]}" =~ "${udid}" ]]; then
xcrun simctl delete ${udid}
fi
done <<< "$watch_os_udids"
(The script can be probably improved though)
Ensure that you have at least one iPhone-Watch pair in your simulator list (xcrun simctl list
)
Is there a plan to fix how pod lib lint selects watch simulators?
Even with 1.12.0, I'm still seeing failures:
https://github.com/google/gtm-session-fetcher/actions/runs/4294972442/jobs/7484744227
xcodebuild: error: Failed to build workspace App with scheme GTMSessionFetcher-Unit-Tests.
Reason: Cannot test target “GTMSessionFetcher-Unit-Tests” on “Any watchOS Simulator Device”: Tests must be run on a concrete device
With 1.12.0, we've been able to successfully restore watchos
to our pod lib lint
build tests, for the first time with Xcode 14.
We've never been able to run test specs for watchos
which looks like you're doing.
Unfortunately this is still not working for us either:
-> Pod installation complete! There is 1 dependency from the Podfile and 2 total pods installed.
Building with `xcodebuild`.
$ /usr/bin/xcodebuild clean build -workspace /var/folders/bl/wbxjgtzx7j5_mjsmfr3ynlc00000gp/T/CocoaPods-Lint-20230302-2072-11u0ac8-PurchasesHybridCommon/App.xcworkspace -scheme App -configuration Release CODE_SIGN_IDENTITY=- -sdk watchsimulator -destination id=A0259AC0-8B2E-4108-B955-0346B484F15B
Command line invocation:
/Applications/Xcode-14.1.app/Contents/Developer/usr/bin/xcodebuild clean build -workspace /var/folders/bl/wbxjgtzx7j5_mjsmfr3ynlc00000gp/T/CocoaPods-Lint-20230302-2072-11u0ac8-PurchasesHybridCommon/App.xcworkspace -scheme App -configuration Release CODE_SIGN_IDENTITY=- -sdk watchsimulator -destination id=A0259AC0-8B2E-4108-B955-0346B484F15B
User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES
Build settings from command line:
CODE_SIGN_IDENTITY = -
SDKROOT = watchsimulator9.1
2023-03-02 18:21:35.299 xcodebuild[2435:13349] Writing error result bundle to /var/folders/bl/wbxjgtzx7j5_mjsmfr3ynlc00000gp/T/ResultBundle_2023-02-03_18-21-0035.xcresult
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ id:A0259AC0-8B2E-4108-B955-0346B484F15B }
The requested device could not be found because no available devices matched the request.
Available destinations for the "App" scheme:
{ platform:watchOS, id:dvtdevice-DVTiOSDevicePlaceholder-watchos:placeholder, name:Any watchOS Device }
{ platform:watchOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-watchsimulator:placeholder, name:Any watchOS Simulator Device }
{ platform:watchOS Simulator, id:E4E68107-5F5E-4465-A4F4-84127452B78A, OS:9.1, name:Apple Watch SE (40mm) (2nd generation) }
{ platform:watchOS Simulator, id:7A34905B-E196-451C-844D-FEE14614F54C, OS:9.1, name:Apple Watch SE (44mm) (2nd generation) }
{ platform:watchOS Simulator, id:A0259AC0-8B2E-4108-B955-0346B484F15B, OS:8.5, name:Apple Watch Series 5 (40mm) }
{ platform:watchOS Simulator, id:320D632C-B34A-4631-9316-759976F281C8, OS:9.1, name:Apple Watch Series 5 (40mm) }
{ platform:watchOS Simulator, id:1DC0569E-60D1-490D-8D18-CEDB0C9E7927, OS:8.5, name:Apple Watch Series 5 (44mm) }
{ platform:watchOS Simulator, id:C1310AE1-107D-4DE3-B658-BC33A45C4061, OS:9.1, name:Apple Watch Series 5 (44mm) }
{ platform:watchOS Simulator, id:AD6956CB-957C-4396-8B3C-14CEAD1FDD10, OS:8.5, name:Apple Watch Series 6 (40mm) }
{ platform:watchOS Simulator, id:7543BB53-1D42-42D8-8E7A-17144F3D0684, OS:9.1, name:Apple Watch Series 6 (40mm) }
{ platform:watchOS Simulator, id:7DCC8291-880F-43E4-8F09-65C1368D8386, OS:8.5, name:Apple Watch Series 6 (44mm) }
{ platform:watchOS Simulator, id:6EFE3B05-E90F-4462-99E0-3E60DC8A3FCF, OS:9.1, name:Apple Watch Series 6 (44mm) }
{ platform:watchOS Simulator, id:8D24FD3F-C77C-4430-8FAC-DA50AC2BBC2A, OS:8.5, name:Apple Watch Series 7 (41mm) }
{ platform:watchOS Simulator, id:8898253D-63CA-4B7B-8BA7-541D6BE5AA03, OS:9.1, name:Apple Watch Series 7 (41mm) }
{ platform:watchOS Simulator, id:6293CC5D-1DA4-45CA-8AE9-FB9AF7410220, OS:8.5, name:Apple Watch Series 7 (45mm) }
{ platform:watchOS Simulator, id:0D576C6E-FDC8-4732-81F6-1F4FB3645113, OS:9.1, name:Apple Watch Series 7 (45mm) }
{ platform:watchOS Simulator, id:EDDFD59E-5799-463E-9C52-4BCFC066C3ED, OS:9.1, name:Apple Watch Series 8 (41mm) }
{ platform:watchOS Simulator, id:0DC8EF45-0FFC-4E35-90EB-C568F4D5DEB7, OS:9.1, name:Apple Watch Series 8 (45mm) }
{ platform:watchOS Simulator, id:5ED61559-6467-4EAE-AD30-805B2CD87C17, OS:9.1, name:Apple Watch Ultra (49mm) }
{ platform:iOS Simulator, id:E616C409-03A4-4A07-B2DC-FFF7544CBCCD, OS:16.1, name:iPhone 14 }
{ platform:iOS Simulator, id:F1215707-3211-428B-BD73-4C70637D400D, OS:16.1, name:iPhone 14 Plus }
{ platform:iOS Simulator, id:D1327065-A7D0-4C7D-A8E6-21C5F21F5B2C, OS:16.1, name:iPhone 14 Pro }
{ platform:iOS Simulator, id:B71CBE55-DCEC-414B-89AA-F23A19AE5820, OS:16.1, name:iPhone 14 Pro Max }
Can this be reopened? The issue isn't actually fixed. It's unfortunate to have to use Xcode 13 because it's not even supported to submit apps anymore.
Another hint for anybody else also encountering this issue. I had exactly the same issue as OP, but I was then able to lint and release our pod.
I had Xcode 14.2 and 14.3 installed in parallel. My xcode-select
was set to 14.2. So when linting Cocoapods would then unfortunately chose a watch simulator that was created when installing Xcode 14.3, which is unknown to 14.2 --> 💥
My fix was to switch to Xcode 14.3 and do the linting and release:
sudo xcode-select -s /Applications/Xcode-14.3.app/Contents/Developer
Update:
So I just ran into this again and finally found the reason. The issue is that the watch simulator Cocoapods tries to use for linting doesn't have a paired iOS simulator yet.
So for fixing it, use that watch device from the error message and pair a iOS simulator using the command:
xcrun simctl pair <watch device id> <phone device id>
Example:
xcrun simctl pair 96AAD8C9-F7B6-4487-A785-2A22581EB5B6 081F9AF2-55F7-4AB1-9620-8E304FC44841
For the watch device id, use the id that it tries to find from your build logs error message. For phone device id, use any iOS 16.2 simulator.
Warning: Make sure that the phone device doesn't have a pair watch yet! If your phone simulator have 2 or more paired watches, make sure that the correct watch is the active watch from the Xcode "Devices and Simulators" window! Won't work otherwise!
This issue is still happening using Xcode 14.3.1 and Cocoapods 1.12.1, I have only one watchos simulator and paired, but it stills gives me the "xcodebuild: error: Failed to build workspace App with scheme Pod-Unit-Tests.: Cannot test target “Pod-Unit-Tests” on “Any watchOS Simulator Device”: Tests must be run on a concrete device"
Can we reopen this?
Report
What did you do?
Ran
pod lib lint
on my pod with Xcode 14.What did you expect to happen?
I expected CocoaPods to run linting and tests and succeed if tests passed.
What happened instead?
Although tests succeeded, the command indicated failure with following results:
On closer inspection I witnessed error is happening when building with
xcodebuild
:This error doesn't make sense as the destination id that is said to be unavailable is present in available destination list for app scheme. And this error only happens for
watchOS
platform. The complete log when running with GitHub action. available here.CocoaPods Environment
Stack
Installation Source
Plugins
Project that demonstrates the issue
Demonstration project: https://github.com/SwiftyLab/AsyncObjects/tree/obj-wait-err, use the same branch as in the url.