I'm trying to push a private pod. When I do it, I get this error:
- ERROR | [iOS] unknown: Encountered an unknown error (Could not find a
iossimulator (valid values: ). Ensure that Xcode -> Window -> Devices has at least one
iossimulator listed or otherwise add one.) during validation.
I'm running Xcode 10, and I recently had Xcode 10.1 beta on my machine. Also, I had regular cocoapods (1.5.3) and the latest beta of that (1.6.0.beta.1).
To reduce complexity, I removed both betas from my machine. So, just the released versions. I'm still seeing this error.
I can't imagine what could've happened here. But something is out of whack. I'd really prefer to not completely remove Xcode, or do something else more drastic. But I'm totally stuck.
Other people on my team are able to pull the code, and do a pod repo push
, but I can't from my own machine.
Thanks for any help/advice.
do below steps it solved my issue For XCode 10.X and 11.X
If above will not work for your system, follow the below 3 steps, it will surely work
If you have Xcode 10.1 installed, _even if Xcode 10.0 is set as the default version of Xcode, the output from simctl
has a different format, specifically for availability. The rest of the fields appear to be the same, just not this one. You can see this JSON calling xcrun simctl list -j
. And Cocoapods do not update their wrapper to this format yet.
I prepared temporary step-to-spet Hotfix of this issue. It work`s for me.
In log find this line - ERROR | [iOS] unknown: Encountered an unknown error (Could not find a
iossimulator (valid values: ). Ensure that Xcode -> Window -> Devices has at least one
ios simulator listed or otherwise add one.
Under it you will see such line: /usr/local/lib/ruby/gems/2.5.0/gems/fourflusher-2.0.1/lib/fourflusher/find.rb
.
sudo vi /usr/local/lib/ruby/gems/2.5.0/gems/fourflusher-2.0.1/lib/fourflusher/find.rb
I
Simulator.new(device, os_name, os_version)
....Simulator.new(device, os_name, os_version) if device['availability'] == '(available)' || device['isAvailable'] == 'YES'
:wq
pod trunk push YourLibrary.podspec
should work.If something does not work, please reply.
or
The above solutions will work on a specific Xcode version. To get the solution that works with any Xcode version use the following. Rather than editing the file, you can copy entire content from https://github.com/CocoaPods/fourflusher/blob/master/lib/fourflusher/find.rb and replace.
I got this error after running the Xcode 10.2 beta. Unfortunately the previous answers didn't make the error go away. I don't know exactly what changed but I found a workaround to get it working:
find.rb
of fourflusher
, you can tell by the location on the error after running the pod trunk push
command. Something like: /usr/local/lib/ruby/gems/2.5.0/gems/fourflusher-2.0.1/lib/fourflusher/find.rb
if device['availability'] == '(available)'
os_name
and os_version
are set. If you look in the comment above it expects to split # Sample string: iOS 9.3
into iOS
and 9.3
. In my case they were empty or something else so I set them myself.|| device['isAvailable'] == true
In the end that part looks like this:
if device['availability'] == '(available)' || device['isAvailable'] == true
os_name = "iOS"
os_version = "12.1"
Simulator.new(device, os_name, os_version)
end
THIS IS NOT A PERMANENT SOLUTION!!! It's just how I got it to work for now until what changed in the Xcode 10.2 beta is officially supported by cocoapods.
I noticed then when you run xcrun simctl list -j
on a mac that never installed the beta you have os names like com.apple.CoreSimulator.SimRuntime.iOS-12-1
and iOS 12.1
.
After installing the Xcode 10.2 I still see the com.apple.CoreSimulator.SimRuntime.iOS-12-1
but the iOS 12.1
one is gone. I'm assuming find.rb
used the the latter to find the os_name
and os_version
values.
This is why I set them myself.
Hope this helps other people, good luck!
After installing Xcode11-beta had the same issue:
- ERROR | [iOS] unknown: Encountered an unknown error (Could not find aiossimulator (valid values: ). Ensure that Xcode -> Window -> Devices has at least oneiossimulator listed or otherwise add one.) during validation.
Solved it by following these steps:
Go/Go to Folder...
/usr/local/lib/ruby/gems
{your gem version}/gems/fourflusher-{version}/lib/fourflusher/
cd
(cd and a space)fourflusher
folder (the one that has the find.rb
file)sudo vi find.rb
i
to be able to edit the filedevice['availability'] == '(available)' || device['isAvailable'] == 'YES'
|| device['isAvailable'] == true
devices.map do |device|
if device['availability'] == '(available)' || device['isAvailable'] == 'YES' || device['isAvailable'] == true
Simulator.new(device, os_name, os_version)
end
end
:wq
to save the filepod lib lint
to lint it or pod trunk push
to push itIf you mistyped something or just want to totally start all over again you should uninstall and install fourflusher
like so before starting all over agin from step 1:
Uninstall: sudo gem uninstall fourflusher
Install: sudo gem install fourflusher
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With