Xamarin.iOS Can't compile project “app was bui

2019-07-29 07:16发布

问题:

I'm working with Xamarin.iOS, right now I'm doing some test with a library(from GitHub) that provides some Material UI elements, it already have a Xamarin binding and some samples, the problem is that I can't compile the samples project.

I get the following error: dyld: app was built for iOS 10.2 which is newer than this simulator 10.1

/Users/user/Projects/MaterialControls.Xamarin.Sample/iOS/LaunchScreen.storyboard: Error: dyld: app was built for iOS 10.2 which is newer than this simulator 10.1 2017-03-10 11:57:49.396 ibtoold[3878:537684] [MT] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEInterfaceBuilder/IDEInterfaceBuilder-11762/InterfaceBuilderKit/Utilities/IBAbstractInterfaceBuilderPlatformToolManager.m:254 Details: Failed to attach to Interface Builder Cocoa Touch Tool with error: Error Domain=com.apple.InterfaceBuilder Code=-1 "Encountered an error communicating with Interface Builder Cocoa Touch Tool." UserInfo={NSUnderlyingError=0x7fdce34aea00 {Error Domain=com.apple.InterfaceBuilder Code=-1 "Failed to launch Interface Builder Cocoa Touch Tool via CoreSimulator spawn" UserInfo={NSLocalizedDescription=Failed to launch Interface Builder Cocoa Touch Tool via CoreSimulator spawn, NSUnderlyingError=0x7fdce345dfb0 {Error Domain=com.apple.InterfaceBuilder Code=-1 "Failed to handshake with platform tool" UserInfo={NSUnderlyingError=0x7fdce3467550 {Error Domain=com.apple.InterfaceBuilder Code=-1 "" UserInfo=0x7fdce0c18e70 (not displayed)}, NSLocalizedFailureReason=Failed to open connection over FIFOs with platform tool, NSLocalizedDescription=Failed to handshake with platform tool}}}}, NSLocalizedDescription=Encountered an error communicating with Interface Builder Cocoa Touch Tool., NSLocalizedRecoverySuggestion=Please check Console.app for crash reports for "Interface Builder Cocoa Touch Tool" for further information., NSLocalizedFailureReason=Interface Builder Cocoa Touch Tool (3880) failed to launch and exited with status 6} Object: Method: +_THREADSAFE_launchNewToolWithLaunchContext:executionContext:toolProxyClass:failureContext:requestingMethod:error:forReason: Thread: {number = 1, name = main} Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide. 2017-03-10 11:57:49.563 ibtoold[3878:537684] [MT] IBPlatformTool: *** Failed to launch tool with description System content 2x for IBCocoaTouchFramework-NineOneAndLater w/ default fidelity: Encountered an error communicating with Interface Builder Cocoa Touch Tool. (Failure reason: Interface Builder Cocoa Touch Tool (3880) failed to launch and exited with status 6): Failed to launch Interface Builder Cocoa Touch Tool via CoreSimulator spawn: Failed to handshake with platform tool (Failure reason: Failed to open connection over FIFOs with platform tool): : Failed to open FIFOs for handshaking with platform tool (Failure reason: Interface Builder Cocoa Touch Tool exited before we could handshake) 2017-03-10 11:58:00.489 ibtoold[3878:537684] [MT] IBPlatformTool: Wrote failed marshalling request diagnostics to path: /var/folders/ys/w39_59552d9f24bfwk9cvjlm0000gq/T/IB-agent-diagnostics_2017-03-10_11-57-55_996000 (MaterialControls.Xamarin.Sample.iOS)

Here's what I've tried:

  • Update Xcode (already had the latest version 8.2.1 8C1002)
  • Update to macOS Sierra
  • Update Xcode again (it said it installed some new tools for Sierra)
  • Update Xamarin Studio (already had the latest version)
  • Update project packages
  • Tried to create a simulator with 10.2 but it doesn't appears as an option
  • Tried to install 10.2 runtime but it doesn't appears as an option to download
  • Tried to run in an iPhone with 10.2.1 (14D27)
  • Changed the deployment target to diferente versions

None of the above worked, I keep getting the same error. I'm very new to developing for iOS, I've used Xamarin for Android only, so I might be missing something obvious.

Any help will be appreciated.

回答1:

If you are using Xcode 8.2.1, the iOS 10.2 Simulator should be installed by default. The only way for it to run on a simulator if you cannot use the 10.2 simulator is to lower the deployment target to 10.1 or below.

If you've already tried lowering the deployment target, what is the error you are getting then?



回答2:

After trying a lot of solutions I ended up reinstalling Xcode completely, that fixed whatever error I had.

I suggest to anyone with this or similar problems that if after two or three attempts to fix this you still have issues, stop wasting time like me and go straight for a full reinstall.



回答3:

What worked for me in this situation was removing the globally-available directory of simulators, /Library/Developer/CoreSimulator/.