Adding UserNotifications.framework causes codesign -1 error (Xcode 8) - ios

I'll start with just the error,
/usr/bin/codesign --force --sign <keyremoved> --preserve-metadata=identifier,entitlements --timestamp=none /Users/charlesgeorge/Library/Developer/Xcode/DerivedData/Unity-iPhone-cvqmwrcjxssykmdqdwkfdmzbtrxc/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/InstallationBuildProductsLocation/Applications/Lucktastic.app/Frameworks/UserNotifications.framework
/Users/charlesgeorge/Library/Developer/Xcode/DerivedData/Unity-iPhone-cvqmwrcjxssykmdqdwkfdmzbtrxc/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/InstallationBuildProductsLocation/Applications/Lucktastic.app/Frameworks/UserNotifications.framework: bundle format unrecognized, invalid, or unsuitable
Command /usr/bin/codesign failed with exit code 1
This only occurs on Archive. Running on my phone loads correctly.
Things I've tried so far.
Delete Derived Data, clean, clean build-> same issue
Changing to managed provisioning
Nada
The culprit seems to be UserNotifications.framework.
If I set it as a linked framework, it will build, but when I run it on iOS I get an error on iOS9. I've embedded the binary instead, and that gets things to run okay, but that starts the codesigning issues. This is the setup
http://screencast.com/t/89eoG82gdjW
Any ideas on why that won't codesign properly, or how to link framework correctly with iOS 9?

Okay,
After working for a while. The issue is that I shouldn't have even been including that framework. I just need to flip the "Uses Push Notifications" to get it working, and remove all references to the UserNotifications.framework.

Related

Command Code sign Failed with a nonzero exit code when building flutter app using Xcode (errSecInternalComponent)

I am getting getting this error:
/Users/administrator/Library/Developer/Xcode/DerivedData/Runner-xxxxxxx/Build/Intermediates.noindex/ArchiveIntermediates/Runner/InstallationBuildProductsLocation/Applications/Runner.app/Frameworks/App.framework: errSecInternalComponent
When building a flutter app.
I found some hints that might be related to xattrs.
xattr -rc folder/to/sources
does not help.
I saw that when running new builds, there are lots of files with com.apple.quarantine attributes in my app's folder.
So I also
xattr -rc ~/development/flutter
After this step, the com.apple.quarantine files stopped to appear, but I still get the same error.
I tried the possible solutions in https://medium.com/#ceyhunkeklik/how-to-fix-ios-application-code-signing-error-4818bd331327
My key / identity seems to be accessible. I also tried a restart and flutter clean.
EDIT:
I also cannot find any information about setting the debuglevel of the codesign binary - is that possible?
EDIT2: Now trying
Xcode 10, Command CodeSign failed with a nonzero exit code
In my case code sign failing issue happened because of keeping project files on shared iCloud directory. I realized that after trying out all popular suggestions like flutter clean or xCode wizardry actions related to this issue, so I finally managed to re-create the project in local non-shared drive directory and the problem disappeared.
I managed to fix that by switching off "Automatically manage signing" and used a distribution certificate and profile which I had to create on the Apple developer website beforehand.

React-native fails to build for ios because command codesign failed with a nonzero exit code

I recently updated my mac and all of a sudden I can't compile the application I've been working on in react-native. The error it gives is Command CodeSign failed with a nonzero exit code.
When it begins running this command, it says the Signing Identity is "-", even though that I have my signing correctly set in XCode.
It also says, ios/build/Build/Products?Debug-iphonesimulator/project.app: resource fork, Finder information, or similar detritus not allowed.
This also results in a `No bundle URL present." in the iOS simulator.
If it helps, I am using yarn ios to compile.
I have tried solutions previously written for other code signing issues, none of which are related to react-native. None of these solutions have worked.
Have you tried cleaning and rebuilding your project? I had a similar problem recently, and what worked for me is deleting everything from YOUR_PROJECT/ios/build/ and running react-native run-ios command again.

unsealed contents present in the bundle root, iOS Application

When i try to run an iOS Project on Device (Previously developed by someone else), Im getting following code signing error.(I'm Using XCode 7.3 and project is using https://github.com/Carthage/Carthage
https://github.com/devxoul/CocoaSeeds)
<App Name>.app: unsealed contents present in the bundle root
Command /usr/bin/codesign failed with exit code 1
I tried to add -vvvv parameter expecting more information regarding the issue, but codesign was not giving more information than previous error.
Obviously the project runs on the simulator without any issue,
Any help to get much more information regarding which resource/file make the codesign fails, or any help to resolve the issue would be grateful
Thanks

Xcode 5 "error: can't exec 'codesign' (No such file or directory)"

Someone recently posted a similar issue at can't exec 'codesign' (No such file or directory)
However, for whatever reason, it has received a down-vote rather than something helpful. So I am going to try to post this myself, with some additional data in hopes that some kind SO'er has been through this or just knows what the problem is.
I have a project that builds fine under Xcode 4.x, but ever since installing Xcode 5 DP2 (and DP3,4 and 5) and now the released version, I get this error when trying to build or archive to anything but the simulator:
CodeSign /Users/cb/Library/Developer/Xcode/DerivedData/MyApp-bdtrjmwxxokvesathmrttgwwesfq/Build/Intermediates/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app
cd /Users/cb/Development/MyAppCore/FrontEnd/Mobile/iOS/MyApp
setenv CODESIGN_ALLOCATE /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:$PATH:/usr/local/mysql/bin:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin"
Using code signing identity "iPhone Developer: CB (D4HZSHL6DF)" and provisioning profile "MyApp_DEV" (BB1C0589-147E-4E12-945D-8FB093B70C70)
codesign --force --sign F5...B73 --resource-rules=/Users/cb/Library/Developer/Xcode/DerivedData/MyApp-bdtrjmwxxokvesathmrttgwwesfq/Build/Intermediates/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app/ResourceRules.plist --entitlements /Users/cb/Library/Developer/Xcode/DerivedData/MyApp-bdtrjmwxxokvesathmrttgwwesfq/Build/Intermediates/ArchiveIntermediates/MyApp/IntermediateBuildFilesPath/MyApp.build/Release-iphoneos/MyApp.build/MyApp.xcent /Users/cb/Library/Developer/Xcode/DerivedData/MyApp-bdtrjmwxxokvesathmrttgwwesfq/Build/Intermediates/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app
If I open Terminal and cd to
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/
and then run the command from there, it executes just fine. So the tools seem alright, as do the provisioning profiles. The problem seems to be with Xcode itself.
It should be noted that I have deleted Xcode completely, as well as my codebase, along with all provisioning profiles and certs. I re-checked-out my code, and re-installed Xcode 5 from a fresh download, entered Apple ID into Xcode and re-created/fetched the certs and profiles, and still have the same issue.
I also went in to the project file itself and removed duplicate PROVISIONING_PROFILE entries per a couple of answers I found, to no avail.
I can build this same project from 2 other machines using Xcode 5, so it is something happening specifically on my box, or with my particular installation, it would seem. But other than that, I am stumped.
Has anyone seen/fixed this, or have any ideas of where to look for an answer?
Thanks for any input!
I copied codesign from /usr/bin/
to:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/u‌​sr/bin
and it worked for me.
Try this:
For Mountain Lion before starting signing process Please run below command as first command.
For Xcode 4.x:
export CODESIGN_ALLOCATE="/Applications/Xcode.app/Contents/Developer/usr/bin/codesign_allocate"
For XCode 5:
export CODESIGN_ALLOCATE="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate"
Solved my problem, thanks for the help. The issue was with my path. I had set my path via /etc/launchd.conf and I was driving myself insane trying to edit my path via ~/.bashrc etc. Make sure /usr/bin is in the path that xcode picks up. This page reminded me: http://overwatering.org/blog/2012/08/setting-path-osx-mountain-lion/
If you added the flag --deep to "Other code signing Flags" i.e. using cut copy paste, it may happen that an "invisible" char was added. In this case the error message is like:
/usr/bin/codesign --force --sign "" --deep --entitlements (...)
No such file or directory
If you see those two quotes "" then there is an invisible char before '--deep' in your compiler settings.
In this case the compiler throws the error message "No such file or directory".
(/usr/bin/codesign seems to not be existing, but it is (!))
To resolve this issue go to build settings, search for 'Other code Signing Flags', delete all entries, and retype them manually (no cut copy paste).

Xcode Build Error - CodeSign

I am trying to test my iOS application on my iPhone. I keep getting the same error.
/Users/usrname/Library/Developer/Xcode/DerivedData/Navigation-abxszioyejjvsqfxzhvoyunubgef/Build/Products/Debug-iphoneos/AppName.app: replacing invalid existing signature
/Users/usrname/Library/Developer/Xcode/DerivedData/Navigation-abxszioyejjvsqfxzhvoyunubgef/Build/Products/Debug-iphoneos/AppName.app: CSSMERR_TP_NOT_TRUSTED
Command /usr/bin/codesign failed with exit code 1
-My provisioning profile and signing requests are good and valid.
-All certs/profiles/devices/App IDs are good and valid.
-I have tried deleting and re-creating the certs several times with no luck.
-The certs are set to use System Defaults instead of Always Trust
-My App ID is set to a xCode wildcard 123456.*
-I have set my Bundle Indentifer to justsometext, as from what I read in the docs, this doesnt matter because of the wildcard.
Can somebody please help me before I rip my hair out. Thanks!
I am using the latest version of Xcode and latest iOS on iPhone.
Have you correctly set the "Trust" section of Apple's WDRC certificate?
http://natelyman.com/index.php?option=com_content&view=article&id=105:what-is-cssmerrtpnottrusted&catid=39:iphone-sdk

Resources