XcodesOrg / xcodes

The best command-line tool to install and switch between multiple versions of Xcode.
MIT License
3.73k stars 130 forks source link

Cannot initialize Platform from invalid String value com.apple.platform.xros #316

Closed LeFatesmith closed 1 year ago

LeFatesmith commented 1 year ago

https://github.com/XcodesOrg/xcodes/issues/299 was closest to the symptoms in this project https://github.com/XcodesOrg/XcodesApp/issues/401 is similar

M2HARDWARE:~ testuser$ /opt/homebrew/bin/brew tap xcodesorg/made
==> Tapping xcodesorg/made
Cloning into '/opt/homebrew/Library/Taps/xcodesorg/homebrew-made'...
remote: Enumerating objects: 12, done.
remote: Counting objects: 100% (12/12), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 12 (delta 1), reused 4 (delta 0), pack-reused 0
Receiving objects: 100% (12/12), done.
Resolving deltas: 100% (1/1), done.
Tapped 1 formula (14 files, 9.5KB).
M2HARDWARE:~ testuser$ /opt/homebrew/bin/brew upgrade xcodesorg/made/xcodes
Error: Not upgrading 1 pinned package:
xcodesorg/made/xcodes 1.4.1
==> No packages to upgrade
M2HARDWARE:~ testuser$ /opt/homebrew/bin/xcodes version
1.3.0
M2HARDWARE:~ testuser$ /opt/homebrew/bin/xcodes runtimes install "iOS 16.0" --directory /Users/testuser/Downloads
Error: dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "sdkToSeedMappings", intValue: nil), _PlistKey(stringValue: "Index 51", intValue: 51), CodingKeys(stringValue: "platform", intValue: nil)], debugDescription: "Cannot initialize Platform from invalid String value com.apple.platform.xros", underlyingError: nil))
M2HARDWARE:~ testuser$ xcodes runtimes --include-betas
Error: dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "sdkToSeedMappings", intValue: nil), _PlistKey(stringValue: "Index 51", intValue: 51), CodingKeys(stringValue: "platform", intValue: nil)], debugDescription: "Cannot initialize Platform from invalid String value com.apple.platform.xros", underlyingError: nil))
M2HARDWARE:~ testuser$ xcodes runtimes install "visionOS 1.0-beta1"
Error: dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "sdkToSeedMappings", intValue: nil), _PlistKey(stringValue: "Index 51", intValue: 51), CodingKeys(stringValue: "platform", intValue: nil)], debugDescription: "Cannot initialize Platform from invalid String value com.apple.platform.xros", underlyingError: nil))
M2HARDWARE:~ testuser$
LeFatesmith commented 1 year ago

Anyone that runs into this...

brew unpin xcodesorg/made/xcodes
brew upgrade xcodesorg/made/xcodes
rpendleton commented 10 months ago

In my case, I had previously installed xcodes using the robotsandpencils/made tap. So even though the formula appeared to be up-to-date, I was still getting an older version of the tool.

After running brew remove xcodes, brew untap robotsandpenciles/made, and brew install xcodesorg/made/xcodes, I was able to install the actual latest version and this issue was resolved.