It seems that somehow i am screwing the SwiftUI Preview. When loading the simplest Preview like
struct MaterialView_Previews: PreviewProvider {
static var previews: some View {
Text("Hello, World!")
}
}
it crashes with following error:
RemoteHumanReadableError: The operation couldn’t be completed. Transaction failed. Process failed to launch successfully. (process launch failed)
BSTransactionError (1):
==transaction: <FBApplicationProcessLaunchTransaction: 0x6000012e01c0>
==error-description: Process failed to launch successfully.
==error-reason: process launch failed
==NSLocalizedFailureReason: Transaction failed. Process failed to launch successfully. (process launch failed)
I can't figure out what causes this issue since i can run my app in the simulator w/o any errors. I use XCode 12 Beta 4. Any ideas?
I couldn't fix the issue yesterday but on starting Xcode today it just worked again. It seems to be a bug in Xcode which will hopefully resolved when Xcode 12 is out of the Beta.
To fix the error try restarting Xcode (didn't help me yesterday, but do it anyway) and restarting your Mac.
I had a similar issue, but in my case diagnostics showed: RemoteHumanReadableError
My fix was to quit Xcode (close window and quit from the menu or use CMD+Q).
Delete contents of:
~/Library/Developer/Xcode/DerivedData/
Related
As titled, I literally create a new project with UI Tests and it just fails.
/.../Test2/Test2UITests/Test2UITests.swift:37: error: -[Test2UITests.Test2UITests testLaunchPerformance] : Failed to terminate com.darylteo.Test2.Test2:27031: Failed to terminate com.darylteo.Test2.Test2:0
t = 60.29s Tear Down
Test Case '-[Test2UITests.Test2UITests testLaunchPerformance]' failed (60.288 seconds).
Test Suite 'Test2UITests' failed at 2022-09-18 13:34:26.714.
Executed 2 tests, with 1 failure (0 unexpected) in 65.396 (65.400) seconds
The app just goes black in simulator, but simulator is still interactive and the app can be hard stopped. I can't run a single test suite without it failing in this way, and running a single test repeatedly suffers from the same issue (works 1 time, fails the next)
I'm guessing this may be some kind of issue with the debugging connection to the simulator, but this kind of flakiness just completely makes XCUITest useless.
M1 MacBook Pro 16" with Pro Max
Monterey 12.5.1 (21GB3)
XCode Version 14.0 (14A309)
Simulator:
Version 14.0 (986.3)
SimulatorKit 624
CoreSimulator 857.7
Assistance appreciated 🙏
Other due diligence:
similar issue, but its 4 years old, and the error message is slightly different, reference to old xcode bug. UITest Failed to terminate com.test.abc:3708 after 60.0s; state is still `Running Foreground
similar issue, but only on Fastlane CI, not Simulator How to fix "Failed to terminate app" error in XCUItests?
another really old post that just brute forces the test. Will possibly try this as a workaround. XCTests failing to launch app in simulator intermittently
open Radar, 6 years old. No resolution http://www.openradar.appspot.com/25548393
Found the issue. I was running XCode in Rosetta mode due to another project that had dependencies that had not been compiled for m1.
Disable Rosetta and the problem no longer persists.
Hope this helps :)
I can't run any Xcode Swift Playground project without getting the error:
Failed to launch process. Failed to attach to stub for playground execution: error: attach failed ((os/kern) invalid argument)
Does anyone know how to solve this?
I've the same issue. If I launch Xcode using rosetta, it doesn't show anything. You must switch off rosetta and it works perfect.
To expand on #E.P's answer
To put off rosetta Go to Aplications-->Xcode-->Get info --> Uncheck rosetta.
You need to restart the system in some cases
I recently noticed all of my crash reports in Firebase Crashlytics were not being deobfuscated, they were all returning compiler errors and memory locations (eg <compiler-generated> - Line 4331771636, EXC_BREAKPOINT 0x0000000102afd6f4), rather than function names and line numbers. I realised it's because Fabric has been shutdown (4th May 2020), so I began the transition to Firebase Crashlytics.
I changed my pod file and added the Firebase/Crashlytics pod, and followed the transition instructions located here.
I've put the following code in my Run script under Build Phases in Xcode:
"${PODS_ROOT}/FirebaseCrashlytics/run"
"${PODS_ROOT}/FirebaseCrashlytics/upload-symbols" -gsp "${PROJECT_DIR}/GoogleService-Info.plist" -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"
When I build my project I get the following error returned from upload-symbols:
Fetching upload-symbols settings...
[31merror: Could not fetch upload-symbols settings: Could not connect to the server.[0m
Command PhaseScriptExecution failed with a nonzero exit code
If I manually run the upload-symbols script in terminal, I get the same error error: Could not fetch upload-symbols settings: Could not connect to the server.
I also noticed that on the Crashlytics dashboard in Firebase, I had lost all my previous crash data and was receiving the message Error loading your issues.
How can I fix the errors and get Crashlytics working like before?
The solution was to force a crash in my app using fatalError(). It is not obvious that this is required to finalise the registration of the new SDK with the Firebase Crashlytics backend.
After doing this, all my historical crash data is available like before, and upload-symbols completes successfully.
I am getting an Error on the top of my interface builder in Xcode 10.3 and while clicking on report bug and checking the log.txt file I found out that fails to open simulator. However I am not starting any simulator.
Here is the Error found in Log.txt
Encountered an error communicating with IBAgent-iOS. (Failure reason: IBAgent-iOS failed to launch): Failed to boot device iPhone Xs (0B8270CC-2BFB-4BB6-90A5-6BA61468A1AD, iOS 12.4, Shutdown) for context <IBCocoaTouchToolLaunchContext: 0x7fe80e754ad0> toolName = IBAgent-iOS, description = <IBCocoaTouchPlatformToolDescription: 0x7fe80e2a0290> System content for IBCocoaTouchFramework-ElevenAndLater <IBSimulatorDeviceTypeDescription: 0x7fe80fab2f90> deviceType=com.apple.CoreSimulator.SimDeviceType.iPhone-XS (Failure reason: Failed to boot iPhone Xs (0B8270CC-2BFB-4BB6-90A5-6BA61468A1AD, iOS 12.4, Shutdown)): Unable to boot the Simulator. (Failure reason: launchd failed to respond.)
Error Domain=com.apple.InterfaceBuilder Code=-1 "Encountered an error communicating with IBAgent-iOS." UserInfo={NSLocalizedFailureReason=IBAgent-iOS failed to launch, NSUnderlyingError=0x7fe80ae44440 {Error Domain=NSPOSIXErrorDomain Code=60 "Operation timed out" UserInfo={NSLocalizedFailureReason=Failed to boot iPhone Xs (0B8270CC-2BFB-4BB6-90A5-6BA61468A1AD, iOS 12.4, Shutdown), NSLocalizedDescription=Failed to boot device iPhone Xs (0B8270CC-2BFB-4BB6-90A5-6BA61468A1AD, iOS 12.4, Shutdown) for context <IBCocoaTouchToolLaunchContext: 0x7fe80e754ad0> toolName = IBAgent-iOS, description = <IBCocoaTouchPlatformToolDescription: 0x7fe80e2a0290> System content for IBCocoaTouchFramework-ElevenAndLater <IBSimulatorDeviceTypeDescription: 0x7fe80fab2f90> deviceType=com.apple.CoreSimulator.SimDeviceType.iPhone-XS, NSUnderlyingError=0x7fe80bd300f0 {Error Domain=NSPOSIXErrorDomain Code=60 "Operation timed out" UserInfo={NSLocalizedFailureReason=launchd failed to respond., NSLocalizedDescription=Unable to boot the Simulator.}}}}, NSLocalizedRecoverySuggestion=Please check Console.app for crash reports for "IBAgent-iOS" for further information., NSLocalizedDescription=Encountered an error communicating with IBAgent-iOS.}
If anyone still looking for an answer to this after Xcode 13 update, I have tried everything they mentioned on the internet and nothing worked except one. The only thing that worked is the complete re-installation of Xcode. Completely uninstall/delete Xcode first and restart the mac and reinstall Xcode then all should be good.
Delete Xcode from Applications Folder and Empty Trash.
Go to ~/Library/Developer and Delete CoreSimulator, Xcode, XCTestDevices Folder. Empty trash
Goto ~/Library/Caches and delete everything starting with com.apple.dt.Xcode, Empty trash
Then Restart your Mac and reinstall Xcode. I used my downloaded Xcode app, AppStore installation will also work, I guess.
Now it all working.
Before that, I have changed the storyboard file using Open as Source Code mode (coz I couldn't open it in Interface Builder - Xcode just hang)
I changed the storyboard design device to iPhone 13 instead of the older device version it had.
<device id="retina6_7" orientation="portrait" appearance="light"/>
I change the existing line with this line. It kinda solve another issue of Xcode hanging, when trying to open with Interface Builder, but it didn't solve Encountered an error communicating with IBAgent-iOS issue when trying to install the app. That issue only got solved when I completely reinstalled the Xcode.
I have managed to fix it just by changing preview device on interface builder
In my case it helped:
clean project
remove derived data
close Xcode
restart Mac
I used DevCleaner XC helper app:
https://apps.apple.com/us/app/devcleaner-for-xcode/id1388020431?mt=12
removed everything, and after that restarted mac. No XC reinstall needed.
This problem caused because, I deleted all directories under "Library/Developer/Xcode" for a purpose. But, I realised I also deleted wrong directories in same time. Then I put back directories from the Bin. It is solved for me.
If you have or have had multiple versions of Xcode open, you may need to reboot or completely re-install the CoreSimulatorService, an evil, globally installed background service that somehow remains online and available to many versions of Xcode despite it being compatible with only one version.
See more here: https://stackoverflow.com/a/72946533/731285
Other symptoms of this issue: Simulators not showing up in the Window > Devices and Simulators listing and simctl throwing errors and being unable to find base iOS SDKs similar to the following:
$ xcrun simctl list
...
-- Unavailable: com.apple.CoreSimulator.SimRuntime.iOS-15-5 --
iPhone 8 (55A90310-8202-4A0D-968B-00F440D42210) (Shutdown) (unavailable, runtime profile not found)
See also:
Command CompileAssetCatalog failed with a nonzero exit code
Xcode device Unavailable, runtime profile not found
In my case, I just had to set team in
Project > Targets > Signing & Capabilities > Team > Personal Team
When I try to run my app in iPhone 5 (I have Xcode 9.2 and iOS 10.3.3) appears "Swift sodlib tool Error … Task failed with exit 1 signal 0 {…"
/Library/Developer/Xcode/DerivedData/DBG-apryihmbeylkqnbsxrtvzxistsoq/Build/Products/Debug-iphoneos/DBG.app/Frameworks/libswiftCore.dylib: unknown error -1=ffffffffffffffff
error: Task failed with exit 1 signal 0 {
/usr/bin/codesign '--force' '--sign' '92CDBC9AD74FA4FC6FE92D8FF8B9AA763901AE1D' '--verbose' '/Users/d/Library/Developer/Xcode/DerivedData/DBG-apryihmbeylkqnbsxrtvzxistsoq/Build/Products/Debug-iphoneos/DBG.app/Frameworks/libswiftCore.dylib'
So how can I fix this? I already try change certificate , change version , change everything . =/
I had a similar issue recently. While in Xcode, try cleaning the project (Cmd + Shift + K), once finished, run the project. After that, a window popped up asking for access to keychain, I put my Mac's password, selected "Always Allow" and the problem went away.
Let me know if this helps.