"/Applications/Xcode.app: a sealed resource is missing or invalid" error while validating Xcode installation - xcode

Today I got the memo from Apple as probably every other Apple developer about potentially infected Xcode installations. (https://developer.apple.com/news/?id=09222015a)
I followed the instructions and tried to validate my Xcode app using the command mentioned. (spctl --assess --verbose /Applications/Xcode.app) The program ran for a while and exited with a "/Applications/Xcode.app: a sealed resource is missing or invalid" message.
The article says "Any result other than ‘accepted’ or any source other than ‘Mac App Store’, ‘Apple System’ or ‘Apple’ indicates that the application signature is not valid for Xcode." However, I'm actually pretty sure my Xcode copy is legitimate (downloaded and updated via App Store with Gatekeeper enabled) so I thought maybe there could be another problem preventing it to validate as it should.
Do you have any ideas what this error message actually means? Do you think I need to reinstall Xcode just in case?
Thanks in advance for your help.

The false positive validation issue appears to be caused by containing previous iOS SDKs in order to be backwards compatible.
A clean install will completely wipe the SDK directories. When you run the validation test after a clean install it will pass. Once you copy previous iOS versions, which, for us, is iOS 8 for iPhone, the validation will fail.
This scenario was tested after updating to XCode 7.0.1 (7A1001) which was released earlier this afternoon.
In order to avoid a clean install, you can temporarily remove the previous SDK version from their respective location, and run the validation. Then, once the validation passes, copy the files back where they belong.

I was getting the same message "a sealed resource is missing or invalid". However i was able to rectify the issue by going into the App Store and downloading the latest version of Xcode - Version 7.0 (7A220), and this seems to have rectified the issue.
Although i did first try updating Xcode through the updates section on the App Store, but for some reason this didn't work. So i would recommend going into the App Store > Search for Xcode > Then install the latest version available to you.

Depending upon gatekeeper settings.please check gatekeeper settings to allow anywhere and revalidate Xcode.

Related

Xcode Workspace "Internal error: missingPackageDescriptionModule"

After updating Xcode to version 13.2 i can't build my project anymore. I have a strange error "Internal error: missingPackageDescriptionModule" related to my Workspace file.
It's definitely related to SPM because Xcode is not loading SPM packages also. I tried to "Reset package caches", "Resolve package caches" and also "Updating to latest package caches" but after all of these operating nothing happens. Deleting derived data, cleaning didn't help too...
I tried also to resolve packages from Terminal using xcodebuild -resolvePackageDependencies but I get error message:
--- xcodebuild: WARNING: The directory /Users/ptocicki/Developer/KFC/kfc-ios also contains the legacy project 'project.pbxproj' - ignoring it and using 'KFC.xcodeproj'.
xcodebuild: error: Could not resolve package dependencies:
Internal error: missingPackageDescriptionModule"
Apple is aware of the issue.
We're currently investigating this issue — thank you to those who have
filed bug reports so far. To workaround this issue, please re-download
Xcode 13.2 directly from the Downloads page.
https://developer.apple.com/forums/thread/696504?answerId=698142022#698142022
🎊 Fixed on v13.2.1 and you can download from here
Explaination
This bug is reported and the v13.2.1 AppStore version but As  Apple suggest here, you should download the Xcode manually from the developer center
Manual download of any Apple developer software
✅ The always working and preferred workaround!
Download directly from Apple:
Latest Release version or
Latest Beta version or
Any version you need and all other downloadable contents
Then extract and move it where you like. This has so many benefits compared to AppStore updates. (like the ability to resume download, not replacing the old one, not wasting hidden directories and etc.)
Note that you should use safari to download it.
⚠️ Important note for developers like me!
The page you’re looking for can’t be found.
If you The page you’re looking for can’t be found message, you may need to use a VPN if you are in a country that the US sanctioned like mine. Because Apple is blocking some IP address ranges.
If you’re using Swift packages either standalone or as dependencies in an Xcode project or workspace, the Mac App Store version of Xcode fails during package resolution with the error “Internal error: missingPackageDescriptionModule.” (86435800)
Workaround: Download Xcode 13.2 directly from the Apple Developer website.
I just got the issues late at night after Xcode updated on its own while I was working on my project, which was not a cool surprise. It appears to be affecting all dependencies. You are not alone in this it's affecting everyone. I did what they recommended and downloaded Xcode directly from the Apples developer site and it fixed all my issues super happy right now!!!!!!!
XCode was updated to 13.2.1 at 12/19 which fix the issue.
https://developer.apple.com/documentation/xcode-release-notes/xcode-13_2-release-notes
If you’re using Swift packages either standalone or as dependencies in an Xcode project or workspace, the Mac App Store version of Xcode fails during package resolution with the error “Internal error: missingPackageDescriptionModule.” (86435800)
Workaround: Download Xcode 13.2 directly from the Apple Developer website.
Seems local package still working. So there is a temporary solution: We can download the dependencies then add them to the project as local paclages.
Please update to Xcode 13.2.1.
If not, download Xcode 13.2 from the Apple Developer website.
Updating from Xcode 13.2 to 13.2.1 from App Store fixed the issue for me.

Missing entitlement - 'UIBackgroundModes' value 'workout-processing' without the required entitlement 'com.apple.developer.healthkit'

I have released my app a couple of times and had the process under control until most recently when I updated from XCode 9 to XCode 10 due to a 3rd party lib requirement.
Everything seems fine when I compile and run on the emulator; but, when I come to the "Validate" (Archive) the app prior to uploading to the app store I am getting an error.
My Setup:
MacOS 10.14.2 (Mojave)
Using XCode 10.1 (10B61)
Error message:
Missing entitlement. watchOS extension
'XXX.app/Watch/aw-xxx.app/PlugIns/aw-xxx Extension.appex' uses
'UIBackgroundModes' value 'workout-processing' without the required
entitlement 'com.apple.developer.healthkit' signed into the bundle.
Watch Extension Capabilities:
The app is built using cordova-8.1.1 and cordova-ios-4.5.5
cordova build ios --buildFlag='-UseModernBuildSystem=0'
In addition to that, the project on XCode 10 has been set to 'Legacy Build System' on File -> Project Settings.
Lastly, the 'aw-xxx Extension.entitlements' has the 'HealthKit' key value set to 'YES' under the 'aw-xxx Extension' folder as one could expect.
Any help or pointers would be much appreciated.
I'm happy to provide more info, logs, etc as well, thanks!
After following the comment below I managed to get my app to validate once again on XCode 10:
Hi #guikeller Just wondering if it is related. I had similar issue while doing a ionic cordova app release. I figured the
com.apple.developer.healthkit
is missing in my platforms/ios/myApp/Entitlements-Release.plist. It does exist in Entitlements-Debug.plist. All I did is copied the key from the debug file to release and app store accepted it.
Source: https://github.com/apache/cordova-ios/issues/475#issuecomment-450174628
In addition to that, I was also able to submit my app into the app store.

Packaging error when switching to arm64 (arm5 was OK)

I just plugged in a new iPhone 6, created a provisioning profile and then I launched the app I'm developing on the device. It compiled fine, but at linking stage it errored out with:
ProcessProductPackaging
...
error: class '(null)' of input object does not respond to either selector writeToFile:options:error: or writeToFile:atomically
I cannot find any information of what that is. I do not get any specific code reference to relate it to. Did anyone experience this?
Personally I was able to solve this issue by rebuilding the project a second time. I think I was only experiencing it after revoking and requesting a certificate.
Odd for it to jump at me and disappear though.
I just restarted Xcode then the error was disappeared
I've tried turning the "Automatically managed signing" off and on again, then the issue disappeared. Note: rebuilding didn't help for me, cleaning either.
I removed an external library and related code I had and it's now working.
I just changed some provisioning setting and then restarted the xcode afterwards the error was disappeared and archived and then uploaded successfully
Rebuilding the project does the job for me. Actually I was making changes in capabilities while Xcode was building that makes build failed.
The error occurred after I made manual changes to the Xcode .entitlements and Info.plist files: I removed some entries. None of the above mentioned solution attempts worked for me. Every try to create an archive failed.
The solution was to go to Xcode's Capabilities section and switched everything on and off again.
I had the same problem specifically on an App Extension we used for Push Notifications, and I was using Automatically manage signing but it seems the App Groups in capabilities were failing, so I just had to make sure the App Groups were retrieved correctly and this fix it.
Also if you have .entitlements files, and you have App Groups there, make sure they are the same you are using in the capabilities configuration.
Restarted XCode and enabled and disabled to Automatically manage signing

Codesign of Dropbox API fails in Xcode 4.6.3: "code object is not signed at all"

I have an OS X app that's distributed through the Mac App Store, and recently updated to Xcode 4.6.3.
When I run my regular build now, I receive:
Command /usr/bin/codesign failed with exit code 1:
/Users/Craig/Library/Developer/Xcode/DerivedData/Mac-dxcgahgplwpbjedqnembegifbowj/Build/Products/Debug/MyApp.app: code object is not signed at all
In subcomponent: /Users/Craig/Library/Developer/Xcode/DerivedData/Mac-dxcgahgplwpbjedqnembegifbowj/Build/Products/Debug/MyApp.app/Contents/Frameworks/DropboxOSX.framework
Command /usr/bin/codesign failed with exit code 1
I can't seem to discern any other changes in my project, so I can't tell if it's an issue related to the 4.6.3 update, or something else.
I have tried restarting Xcode, running a clean build, and cleaning the build folder.
I think I may have figured this one out. I've been running Xcode 4.6.3 on OS X Mavericks, under the impression that any build-specific tools were bundled in the Xcode application.
But, it seems codesign is in /usr/bin. Whether it's put there by one of the Xcode installers or comes with a vanilla system install, I'm not sure. But reading through the man page for codesign, I found this nifty option:
--deep When signing a bundle, specifies that nested code content such as helpers, frameworks, and plug-ins, should be recursively signed
in turn. Beware that all signing options you specify will apply, in turn, to such nested content.
When verifying a bundle, specifies that any nested code content will be recursively verified as to its full content. By default,
verification of nested content is limited to a shallow investigation that may not detect changes to the nested code.
When displaying a signature, specifies that a list of directly nested code should be written to the display output. This lists only
code directly nested within the subject; anything nested indirectly will require recursive application of the codesign command.
And then I found this post (https://alpha.app.net/isaiah/post/6774960) from two weeks ago (~June 2013), which mentions (albeit second-handedly):
#isaiah I asked a guy in the labs about it. He said codesign now
requires embedded frameworks to be signed separately before code
signing the app bundle as a whole.
Manually re-running the codesign command that Xcode normally runs, while adding the --deep flag to the end, signs the application properly.
I'm not yet sure exactly what ramifications this manual signing has, or whether I can tweak the Xcode build to add the --deep flag automatically, but this seems to be the underlying issue. (codesign no longer automatically deeply signs your app bundle.)
As highlighted in other answers, there is a change to the way code signing works. If you've installed any of the Xcode 5 DP's then the new tools will be being used even if you are using Xcode 4.6.X.
All you need to do at this stage (in Xcode 4.6.X) is take the --deep flag suggested above and add it into your code signing flags (Target, Build Settings) see image below.
For me, this problem was caused after dragging a folder named "resources" in my project. After changing its name into anything else(like "resourcessss" for example), the error disappeared.
I had the same problem, but the answer was simple: the code signing identity on my app was set to "-", so simply setting that to "Don't Code Sign" fixed me up.
"-" seems to be the default setting when you carry out some set of actions, although I can't tell you what those are.
This might help somone:
I finally figured out the solution by trial and error. In my case I had a folder name that matched the “Product Name” variable under build settings. This also matched the entire project name! So I simply changed one field. I changed the “Build Settings” -> “Product Name” . The value of MySpecialApp was changed to My-SpecialApp. That was simply it! I then logged back into the Apple developer portal and created a new App ID and mobile provisioning profiles for development and distribution and the rest is history. My releases now work when deployed via the Ad Hoc distribution.
A final note on this. This is definitely a bug that Apple should either alert the user that they have done something wrong and enable some sort of automated corrective action.
- See more at: http://www.chrisdanielson.com/2012/08/29/codesign-ipa-and-the-code-object-is-not-signed-at-all-problem/#sthash.F0nF3BbC.dpuf
For me it was a corrupted Framework PaddleMAs which:
1. I removed from my Cocoapods File
2. Ran pod install
3. Restarted my Xcode
and it solved the problem. For some reason a corrupted framework will prevent it being signed unfortunately XCode doesn't show this error really clearly and give you a good fix suggestion. Have raised a bug with Apple to fix.

XCode4 Organizer - App fails validation due to CFBundleVersion error

When submitting a new version of our app to the Apple app store, I am receiving the dreaded "This bundle is invalid. The key CFBundleVersion in the Info.plist file must contain a higher version than that of the previously uploaded version."
I'm puzzled by this, since I've updated this app many (>6) times previously. The current version app details from iTunes Connect shows that the bundle version previously uploaded is "5780".
The new version has a bundle version of 6001, however, this results in the aforementioned validation error.
I have tried various permutations of the bundle string (5781, 10000, 1.6.1, etc.) all to no avail. This is on Xcode 4.3.2 running on Lion 10.7.3 Again, this far from the first update and the same process has worked previously - the only difference that I am aware of is that the previous update was done with Xcode 4.3.1.
Thanks in advance for any suggestions or pointers!
Try to increase not only build number - CFBundleVersion (5780->5781) but also marketing version - CFBundleShortVersionString (1.6.0 -> 1.6.1)
Just encountered this error when trying to update an app from 1.09 to 1.5. The solution for us appeared to be changing 1.5 to 1.50, but that wouldn't have helped with your numbering scheme. Perhaps it was an issue of needing to wait, and that number worked simply because more time had elapsed. The app then validated and submitted without issue.

Resources