In my case, the problem was unsigned frameworks.
Xcode 11 or above:
Go to Build Phases, expand Embedded Frameworks and select all Code Sign on Copy checkboxes.
Xcode 10 or earlier:
Build Phases > Copy Files > Code Sign on Copy (select all checkboxes)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…