Tag Archives: iOS Error

[Solved] IOS Error: Command MergeSwiftModule failed with a nonzero exit code

environment

Xcode13. 2 the first project created is set. The minimum version of IOS is 15.2, which has been compiled several times. The minimum IOS version of the switching project is IOS 10.0 After 0, the following errors appear:

error: Command MergeSwiftModule failed with a nonzero exit code

Solution:

Method 1: clean (Command + Shift + k)

Method 2: Change (Project -> target -> builfsetting -> compilation mode -> debug -> switch to whole module) (but this may slow down subsequent compilation)

Swift Error fatal error: unexpectedly found nil while unwrapping an Optional value

Fatal error: Unpacking an empty Optional value.
Wrapping: Use an exclamation point after Optional. Such as “value!”
Error code:

let testString =”lalala”
Let a = testString. ToInt ();
Println (” \ (a! “)

You cannot unpackage an empty Optional, otherwise a runtime error will be reported. Therefore, it should be determined whether it is null before unpacking Optional.
Correct writing:

let testString =”lalala”
Let a = testString. ToInt ();
If (a! = nil) {
Println (” \ (a! “)
}