IOS simulator is not open and shows only a black screen how can I open this simulator, I am using the latest Xcode. I try to Erase all simulator data but can't open the emulator
CodePudding user response:
I spent a few days struggling with this. If you look at the iOS terminal which you can bring up under tools -> iOS -> Open Terminal on Paired Mac..., you will probably see:
Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'CLAP, Version=4.6.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044) at Xamarin.Messaging.Terminal.Program.Main(String[] args)
Whether this is a deployment issue by visual studio team or not, I'm not sure. I went back to visual studio 17 LTCS version, and still had the same issue which argues against that. In any case, for me it worked once I turned off remote emulator to windows.
To do that, go: Tools -> options... Then scroll down to Xamarin, expand that and click iOS settings. About 2 or 3 sections down, you should see Simulator and below that a check box: Remote Simulator to Windows
Uncheck that. In my case, I also had to close out the simulator that was sitting on the black screen. After that, it opened my app perfectly. It's inconvenient, but I just moved my Mac from back table up to my desk so I can work with the emulator.
On a side note in case someone sees the same, this version also will NOT let me sync certificates / profiles in Tools -> iOS -> accounts as it gives me a security error that I must use XCode 7.3 which in past showed up on people using free apple accounts. I am on XCode 15 and have had a paid app for years, so that's not the case. I WAS able to sync with all of my corporate accounts. Fortunately, my certificates / profiles are already synced, but if someone can't get started because they lack them entirely, making a corporate account (if appropriate) might help based on my observations.
Hope that helps at least some of the people arriving here!
CodePudding user response:
This happens when the widget is not wrapped with Scaffold/MaterialApp.
Alternatively, try
flutter clean
and then flutter pub get
. It should work then.