which carthage: /usr/local/bin/carthagecarthage version: 0.31.0xcodebuild -version: Xcode 10.1 Build version 10O35n--no-build?  no--no-use-binaries?  no--use-submodules?  no--cache-builds?  no--new-resolver?  noCartfile
github "SnapKit/SnapKit" ~> 4.0
github "xmartlabs/Eureka" ~> 4.3
github "yeahdongcn/UIColor-Hex-Swift" >= 4.0.1
Carthage Output
localhost:ios $ carthage build
*** xcodebuild output can be found in /var/folders/rf/m6rlyw2n12lfbgfm64xmmycw0000gn/T/carthage-xcodebuild.gPLWS9.log
*** Building scheme "Eureka" in Eureka.xcworkspace
Could not find any available simulators for iOS
Actual outcome
Carthage did not build dependencies. Tried building using xcodebuild, everything works just fine. And the last line of /var/folders/rf/m6rlyw2n12lfbgfm64xmmycw0000gn/T/carthage-xcodebuild.gPLWS9.log is ** ARCHIVE SUCCEEDED **, no error or warnings found in log file.
Expected outcome
Carthage should build the project's dependencies without error.
This issue happened after I installed MacOS Mojave and install Xcode 10.1 beta.
* ARCHIVE SUCCEEDED *
This is for device SDK build, so that should be fine even if there is no available simulators. Please make it sure that you have iOS simulators. I think $ fastlane snapshot reset_simulators is an easy way to reset simulators: https://docs.fastlane.tools/actions/snapshot/#completely-reset-all-simulators
I did have iOS simulators, and tested iPhone 7 and XS already, both works. I doubt that carthage failed to find out the location of iOS simulators.
It seems this logic is triggered: https://github.com/Carthage/Carthage/blob/master/Source/CarthageKit/Xcode.swift#L637
But running xcrun simctl list devices --json produce reasonable outputs:
{
  "devices" : {
    "iOS 12.1" : [
      {
        "state" : "Shutdown",
        "isAvailable" : "YES",
        "name" : "iPhone 5s",
        "udid" : "2647F251-04A3-4DB8-8684-D66189869B42",
        "availabilityError" : ""
      },
      {
        "state" : "Shutdown",
        "isAvailable" : "YES",
        "name" : "iPhone 6",
        "udid" : "41E60ECB-EB0E-4A8D-BAF7-DB0859AA05D8",
        "availabilityError" : ""
      },
      ...
Well, I've found the root cause of the issue.
Apple somehow changed the json data format of command: xcrun simctl list devices --json, the key isAvailable return (available) in the past, but now return YES, so the code check here failed:
So that is Xcode 10.1 specific issue, right? Could you please use Xcode 10.0 for now.
Looks like the availability key is renamed to isAvailable. This is annoying 馃槄
FYI @giginet.
Just checked Xcode 10.0 from my friend, which produced old format. So it really looks like a Xcode 10.1 only issue.
Downloading Xcode 10.0 to confirm it myself.
Thanks!I will fix this weekend
Deleted Xcode10.1 and installed Xcode10.0 through App Store, but the issue remains the same. Don't know what went wrong...
Maybe it's better to accept both format to make it more compatible with Xcode.
It seems this logic is triggered: https://github.com/Carthage/Carthage/blob/master/Source/CarthageKit/Xcode.swift#L637
But running
xcrun simctl list devices --jsonproduce reasonable outputs:{ "devices" : { "iOS 12.1" : [ { "state" : "Shutdown", "isAvailable" : "YES", "name" : "iPhone 5s", "udid" : "2647F251-04A3-4DB8-8684-D66189869B42", "availabilityError" : "" }, { "state" : "Shutdown", "isAvailable" : "YES", "name" : "iPhone 6", "udid" : "41E60ECB-EB0E-4A8D-BAF7-DB0859AA05D8", "availabilityError" : "" }, ...
I have the same issue even with Xcode 10.0. Is that possible to manually replace the boolean value with the "available" value as in the previous version. How can I localize this device Json list?
Hi! I fixed on #2606
Looks good to me.
Dear all, is this issue already fixed on 0.31.2? I tried to install Hyperoslo's Cache, but it still returns the same error...
I'm not sure whether this helps - previously, I had Xcode 10.1 installed but only have iOS 11 simulators. I'm trying to download the simulators for iOS 12... maybe it will fix the issue.
After downloading the simulators and running xcrun simctl list devices --json, I got this result for the iOS 12:
"iOS 12.1" : [
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone Xs",
        "udid" : "AC574BD9-25CE-415C-ABA1-21BB3B64E382",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone Xs Max",
        "udid" : "06ECDF69-B2A4-4562-8CDE-EF6C7D109471",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone X蕗",
        "udid" : "DD1C343D-3EF2-4984-A58E-0A25C9EC343F",
        "availabilityError" : ""
      }
    ]
Somehow the availability and isAvailable exist together for a simulator... huh.
EDIT: The errors are gone after iOS 12 simulator installed! 馃帀 I wonder how the checking code works though... brb reading the source code
Somehow the availability and isAvailable exists together for a simulator... huh.
馃槰
After taking a quick peek on Simulator.swift, I found this code in the selectAvailableSimulator method:
guard let latestOSName = sortedByVersion(Array(allTargetSimulators.keys)).last else {
    return nil
}
I guess my issue was caused by the absence of iOS 12 simulators when using Xcode 10.1. Oh, the joy of having multiple Xcodes...
Then again, thank you very much for the upgrade to all maintainers! 馃憤
I'm author of this code.
I'll check this later....
Thank you very much @giginet ! Since my issue was fixed, there's no need to rush 馃槈
having the same issue (installed xcode10 then deleted) with 0.31.1, fixed after upgraded to 0.31.2
After installing Xcode 10.2 Beta 1 I get the same error. Any suggestions?
I have the exactly the same situation with xCode 10.2, my Carthage was outdated, after update to 0.33 nothing  changed. But after i did brew uninstall carthage --force, and
brew install carthage i see brew link error, i easily fixed it with  brew link --overwrite carthage, now it's build
fwiw... uninstalling/installing Carthage fixes the issue for me.
I have the exactly the same situation with xCode 10.2, my Carthage was outdated, after update to 0.33 nothing changed. But after i did
brew uninstall carthage --force, and
brew install carthagei see brew link error, i easily fixed it withbrew link --overwrite carthage, now it's built
That solution fixed it for me. I am on Mojave 10.14.4 with Xcode 10.2.1 . I tried many different XCode configurations, and wasted about 3 hrs and finally ran across this post. Thank you!
Yeah I still have this issue with carthage 0.33.0
This is with XCode 10.2 and 11.0 beta 3 (I'm not sure how carthage picks the xcode when I have multple installed)
uninstalling and re-installing carthage does not help.
This has been a reliable tool for me for a long time until now, and I have no idea how to fix it.
@thejeff77 You select the version of Xcode to use for Carthage in Xcode > Preferences > Locations > Command Line Tools. Try switching between the two versions you have installed and see if that resolves the issue. With the Xcode 11 beta I've also seen issues where I need to manually start a simulator to make the build work but I see that as an Xcode issue rather than a Carthage issue.
build still fails for the newest version of Xcode 10.3 (non-beta) with the MBProgressHUD library
I didn't have this issue before I upgraded carthage to version 33. I think I upgraded from 31 or 32.
When I switched to the Xcode 11 beta build tools, it worked!
Although this still seems like something you guys might want to look into if you can reproduce it with the Xcode 10.3 build tools with MBProgressHUD.
I was having a lot of other issues too but luckily the 11 tools work.
Thanks for the timely reply @DavidBrunow
brew uninstall carthage --force
brew install carthage
brew unlink carthage && brew link carthage
Most helpful comment
I have the exactly the same situation with xCode 10.2, my Carthage was outdated, after update to 0.33 nothing changed. But after i did
brew uninstall carthage --force, andbrew install carthagei see brew link error, i easily fixed it withbrew link --overwrite carthage, now it's build