2

I'm attempting to build a MacOS app that contains a framework (SwiftyHue 0.4.1) which in itself has a nested dependency (CocoaAsyncSocket 7.6.3). I'm importing SwiftyHue using Carthage. There are no errors during import, however when I hit "run" within Xcode to build my app, it fails and states:

CodeSign /Users/MyName/Library/Developer/Xcode/DerivedData/App_Hue-dilrdxszovgssvcqobfbekteobjr/Build/Products/Debug/App\ Hue.app
    cd "/Volumes/Macintosh HD/Users/MyName2/HDDDocuments/PersonalGithub/AppHue"
    export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate

Signing Identity:     "Mac Developer: myemail@gmail.com (TXXXNXXZXX)"

    /usr/bin/codesign --force --sign 1F45D22C9009847DE3351794C18F6D703CA4AFB2 --entitlements /Users/MyName/Library/Developer/Xcode/DerivedData/App_Hue-appdilrdxszovgssvcqobfbekteobjr/Build/Intermediates.noindex/App\ Hue.build/Debug/App\ Hue.build/App\ Hue.app.xcent --timestamp=none /Users/MyName/Library/Developer/Xcode/DerivedData/App_Hue-dilrdxszovgssvcqobfbekteobjr/Build/Products/Debug/App\ Hue.app

/Users/MyName/Library/Developer/Xcode/DerivedData/App_Hue-dilrdxszovgssvcqobfbekteobjr/Build/Products/Debug/App Hue.app: code object is not signed at all
In subcomponent: /Users/MyName/Library/Developer/Xcode/DerivedData/App_Hue-dilrdxszovgssvcqobfbekteobjr/Build/Products/Debug/App Hue.app/Contents/Frameworks/CocoaAsyncSocket.framework
Command /usr/bin/codesign failed with exit code 1

I tried to "Clean Build Folder", but sadly that didn't work. I've even forked SwiftyHue and had it import the head of the master branch of CocoaAsyncSocket and that didn't work either. I've also attempted to clear the cache and redownload the dependencies/libraries again to no avail.

Any help would be greatly appreciated!

Abushawish
  • 1,466
  • 3
  • 20
  • 35
  • This sometimes happens to me too. There's probably some random file lying around in your app bundle, probably left there by `codesign` itself. Just delete (manually) the entire bundle (`/Users/MyName/Library/Developer/Xcode/DerivedData/App_Hue-dilrdxszovgssvcqobfbekteobjr/Build/Products/Debug/App Hue.app`) and rebuild. That works for me. – Paul Sanders Jun 02 '18 at 09:03
  • 3
    Try also `codesign --deep ...` – Paul Sanders Jun 03 '18 at 06:50
  • @PaulSanders Is that in Build Settings? What is the exact name for that please? I can't find `codesign` anywhere. Thanks – Houman Jan 09 '21 at 22:43
  • @Houman I actually do it in a build phase script. `codesign` is part of macOS. – Paul Sanders Jan 09 '21 at 23:03

1 Answers1

1

The OP reported this error message for an effective subcomponent. I have been experiencing the same message for building the main Cocoa application with no embedded framework. In that case the "not signed at all" subcomponent is the application itself.

This appeared when switching to Xcode 10.

It turned out that the target name has an UTF8 character in the name. Due to the well known MacOS filesystem conundrum regarding UTF8 normalization, the solution is to rename the target in Xcode by copying-pasting the name from the finder directory in order to use the same normalization.

Max_B
  • 887
  • 7
  • 16