[iOS]: Run project on sitmulator failed - ios

I has built my project and run it on simulator. It showed error
The operation couldn’t be completed. (LaunchServicesError error 0.)
I checked system log. It showed:
Jun 8 16:53:08 com.apple.dt.Xcode[29826] <Error>: Error Domain=LaunchServicesError Code=0 "(null)" UserInfo={Error=PackageInspectionFailed, ErrorDescription=Failed to load Info.plist from bundle at path /Users/duong/Library/Developer/CoreSimulator/Devices/A980FDBA-E61F-4ED6-9F43-2C30DB071222/data/Library/Caches/com.apple.mobile.installd.staging/temp.Xf5A16/extracted/xxx.app/Frameworks/Alamofire.framework}
How could I fix that? Please help me. Thank you.

please follow these steps
1. reset simulator
2 delete derived data
3 clean Xcode and try again

Related

"The operation couldn’t be completed. Device was allocated but was stuck in creation state." (Xcode 13 iOS simulator on external device)

In order to save some of the precious 256GB of disk space on the internal drive of my (M1, 2020) MacBook Pro (MYD82LL/A) I ran the following commands in my macOS Terminal after installing Xcode in order to move all the space-hogging components to a 2TB external drive that I named "Developer" when I formatted it:
sudo mv /Applications/Xcode.app /Volumes/Developer/Applications/Xcode.app && sudo ln -s /Volumes/Developer/Applications/Xcode.app /Applications/Xcode.app
sudo mv ~/Library/Developer/CoreSimulator /Volumes/Developer/CoreSimulator && ln -s /Volumes/Developer/CoreSimulator ~/Library/Developer/CoreSimulator && sudo chown -R $USER:staff /Volumes/Developer/CoreSimulator
Despite making absolutely certain to ensure that the CoreSimulator folder has the correct ownership and permissions (hence sudo chown -R $USER:staff /Volumes/Developer/CoreSimulator above), I'm still getting this error on attempt to simulate a device (image downscaled because the 2880x1800 Retina resolution pushes the file size of the screenshot past 2MB):
Making this even more strange, I attempted this from Xcode while also running tail -f ~/Library/Logs/CoreSimulator/CoreSimulator.log in a separate terminal window. The resulting real-time log information seems to defy logic in light of the fact that I made sure (via chown) that I already had write access to the moved directory:
May 3 13:27:12 realkstrawn93-m1mbp CoreSimulatorService[2890] <Warning>: Device BC4197AA-A5E9-4611-98B3-4C96B2CCD460 encountered in creation state at launch. The device will be re-created.
May 3 13:27:12 realkstrawn93-m1mbp CoreSimulatorService[2890] <Error>: Error copying sample content to path /Volumes/Developer/CoreSimulator/Devices/BC4197AA-A5E9-4611-98B3-4C96B2CCD460/data : Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “BC4197AA-A5E9-4611-98B3-4C96B2CCD460” in the folder “Devices”." UserInfo={NSFilePath=/Volumes/Developer/CoreSimulator/Devices/BC4197AA-A5E9-4611-98B3-4C96B2CCD460, NSUnderlyingError=0x6000000000c0 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}
May 3 13:27:12 realkstrawn93-m1mbp CoreSimulatorService[2890] <Error>: Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “BC4197AA-A5E9-4611-98B3-4C96B2CCD460” in the folder “Devices”." UserInfo={NSFilePath=/Volumes/Developer/CoreSimulator/Devices/BC4197AA-A5E9-4611-98B3-4C96B2CCD460, NSUnderlyingError=0x6000000000c0 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}
May 3 13:27:12 realkstrawn93-m1mbp CoreSimulatorService[2890] <Error>: Failed to re-create device that was encountered in the creation state (realkstrawn93-ip13sim (BC4197AA-A5E9-4611-98B3-4C96B2CCD460, iOS 15.4, Creating)): Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “BC4197AA-A5E9-4611-98B3-4C96B2CCD460” in the folder “Devices”." UserInfo={NSFilePath=/Volumes/Developer/CoreSimulator/Devices/BC4197AA-A5E9-4611-98B3-4C96B2CCD460, NSUnderlyingError=0x6000000000c0 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}
May 3 13:27:12 realkstrawn93-m1mbp CoreSimulatorService[2890] <Error>: New device is stuck in creation state, deleting: realkstrawn93-ip13sim (BC4197AA-A5E9-4611-98B3-4C96B2CCD460, iOS 15.4, Creating)
May 3 13:27:12 realkstrawn93-m1mbp CoreSimulatorService[2890] <Error>: Error Domain=NSPOSIXErrorDomain Code=22 "Invalid argument" UserInfo={NSLocalizedFailureReason=Device was allocated but was stuck in creation state. Check CoreSimulator.log for more information.}
May 3 13:27:12 realkstrawn93-m1mbp CoreSimulatorService[2890] <Error>: Error Domain=NSPOSIXErrorDomain Code=22 "Invalid argument" UserInfo={NSLocalizedFailureReason=Device was allocated but was stuck in creation state. Check CoreSimulator.log for more information.}
May 3 13:27:12 realkstrawn93-m1mbp com.apple.dt.Xcode[24690] <Error>: ERROR creating device: Error Domain=NSPOSIXErrorDomain Code=22 "Invalid argument" UserInfo={NSLocalizedFailureReason=Device was allocated but was stuck in creation state. Check CoreSimulator.log for more information.}
May 3 13:27:12 realkstrawn93-m1mbp com.apple.dt.Xcode[24690] <Error>: Error Domain=NSPOSIXErrorDomain Code=22 "Invalid argument" UserInfo={NSLocalizedFailureReason=Device was allocated but was stuck in creation state. Check CoreSimulator.log for more information.}
Note the various "You don't have permission to save the file" errors despite having already used chown -R after the directory move to attempt to rectify any permissions issues that may arise from such. So what else could possibly be wrong here?
I was able to find a workaround for this with the help of this answer
https://stackoverflow.com/a/58304540
The problem is that CoreSimulatorService needs full disk access to create files on a separate drive. To grant access you need to drag and drop com.apple.CoreSimulator.CoreSimulatorService.xpc into the apps area of Security & Privacy > Privacy > Full Disk Access in System Preferences. You can't use the + icon because .xpc files will be grayed out.
For me, this was the path to the xpc file:
/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/XPCServices/com.apple.CoreSimulator.CoreSimulatorService.xpc
I met a similar issue, and I solved like below: About this Mac > Storage > Manage > Developer and Open the screen, delete all cache, then it should work well.
Ended up simply moving all the simulator stuff back onto my local drive anyway and the problem disappeared. Not sure why Xcode complains when the simulators aren’t on the system drive though.

flutter error -> The operation couldn’t be completed. (XCBUtil.PropertyListConversionError error 2

Who knows how can solve this problem?
When I running the iOS, I got this error
Error (Xcode): unable to read property list from file: /Users/pin-chientseng/Desktop/yomate/ios/Runner/Info.plist: The operation couldn’t be completed. (XCBUtil.PropertyListConversionError error 2.)
Could not build the application for the simulator.
Error launching application on iPhone 13 Pro Max.

Xcode Signing error - The operation couldn’t be completed. (OSStatus error -2147416032.)

I made a flutter app. Opened the Runner.xcodeproj and under
runner>target>general>signing
When I select my AppleId for Signing it shows the following error:
The operation couldn’t be completed. (OSStatus error -2147416032.).
I don't know how to resolve this please help.
I'm using Xcode 10.2.1.

Fabric - Unable to complete settings download

I am integrating Twitter in my iOS app using the Fabric app. I've followed all the steps but the process is stuck in the "Verifying installation phase".
I can see this error in the Xcode console log:
[Fabric] Unable to complete settings download Error
Domain=NSCocoaErrorDomain Code=4 "The operation couldn’t be completed.
(Cocoa error 4.)" UserInfo=0x7fac0ac1d1a0
{NSSourceFilePathErrorKey=/spi/v2/platforms/ios/apps/com.xxxxx.yyyyy/settings,
NSUserStringVariant=(
Move
), NSDestinationFilePath=/Users/xxxxxx/Library/Developer/CoreSimulator/Devices/448B0F63-C299-46E5-B455-D4666610023E/data/Containers/Data/Application/F3B667A7-4937-4040-93BD-7727F433E2B2/Library/Caches/io.fabric.sdk.ios.data/com.xxxxx.yyyyy/settings.json,
NSFilePath=/spi/v2/platforms/ios/apps/com.xxxxx.yyyyy/settings,
NSUnderlyingError=0x7fac0ac1c3a0 "The operation couldn’t be completed.
No such file or directory"}
[Fabric] failed to download settings Error Domain=NSCocoaErrorDomain
Code=4 "The operation couldn’t be completed. (Cocoa error 4.)"
UserInfo=0x7fac0ac1d1a0
{NSSourceFilePathErrorKey=/spi/v2/platforms/ios/apps/com.xxxxx.yyyyy/settings,
NSUserStringVariant=(
Move
), NSDestinationFilePath=/Users/xxxxxxxx/Library/Developer/CoreSimulator/Devices/448B0F63-C299-46E5-B455-D4666610023E/data/Containers/Data/Application/F3B667A7-4937-4040-93BD-7727F433E2B2/Library/Caches/io.fabric.sdk.ios.data/com.xxxxx.yyyyy/settings.json,
NSFilePath=/spi/v2/platforms/ios/apps/com.xxxxx.yyyyy/settings,
NSUnderlyingError=0x7fac0ac1c3a0 "The operation couldn’t be completed.
No such file or directory"}
I've already Googled a lot, restarting and so on... but nothing worked.
Any idea?
the problem has been solved removing another crash reporting tools (AppPulse) that still was in the app.

Unable to "apportable load". Give NoneType error

Trying to use apportable for the first time. Keep getting this error:
TypeError: 'NoneType' object is not subscriptable
and also
NSUnderlyingError = "Error Domain=NSPOSIXErrorDomain Code=2 \"The operation couldn\U2019t be completed. No such file or directory\"";
And then the script terminates.
xcode-select --switch /Applications/Xcode.app/Contents/Developer
Background: This can occur if you've updated to Xcode 5. It seems Xcode 5 has a bug that it can generate incorrect output when running xcodebuild.

Resources