XCode 4.3 organizer crash - xcode

I've installed the XCode 4.3. I've seen that in preferences general tab, there is the "iOS device discovery" tab. Maybe it was there before too, but I just noticed now.
So I've checked it, after this I can do anything, but the XCode crashes constantly when I try to access the organizer's devices tab.
Any clues for solution?
Update: I've deleted it and reinstalled it from the Mac App Store, but it didn't help
Update: I've submitted the bug to Apple, they marked it as duplicate and after this they closed both of them. So, I hope we will have a solution from Apple.

I can't take full credit for this. I found it here and added a little bit to the end that I needed in my case.
Create readcert.m with these contents:
#import <Security/Security.h>
#import <Foundation/Foundation.h>
void checkCerts () {
OSStatus status;
const void *keys[] = {
kSecClass,
kSecReturnRef,
kSecMatchLimit
};
const void *values[] = {
kSecClassCertificate,
kCFBooleanTrue,
kSecMatchLimitAll
};
CFDictionaryRef query = CFDictionaryCreate(NULL, keys, values, 3, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
CFArrayRef results;
if ((status = SecItemCopyMatching((CFDictionaryRef) query, (CFTypeRef *)&results)) != noErr) {
NSLog(#"Failed to copy certificates: %d", status);
return;
}
CFIndex count = CFArrayGetCount(results);
CFIndex i;
for (i = 0; i < count; i++) {
SecCertificateRef cert = (SecCertificateRef) CFArrayGetValueAtIndex(results, i);
CFErrorRef error;
CFDictionaryRef vals = SecCertificateCopyValues(cert, NULL, &error);
if (vals == NULL) {
CFStringRef subjectSummary = SecCertificateCopySubjectSummary(cert);
NSLog(#"Found a triggering certificate: %#", subjectSummary);
}
}
CFRelease(results);
}
int main (int argc, char *argv[]) {
NSAutoreleasePool *p = [[NSAutoreleasePool alloc] init];
checkCerts();
[p release];
return 0;
}
Then, compile it with:
clang -o readcert readcert.m -framework Security -framework Foundation
Then run it:
./readcert
It should output the name of the bad certificate. In my case, it was a certificate from a Linksys router. I deleted the certificate from my keychain, but Xcode was still crashing and readcert was still saying it was there, so I ended up executing this command.
sudo security delete-certificate -c Linksys_WRVS4400Nv2
I'm not sure where the certificate was coming from, I didn't see it in the login or system keychains, but after deleting it from the command line, everything was peachy again in Xcode.

Same Problem here. I just created a new user on my system. With it I have no problem open the Devices in the Organizer Window.... strange...
Edit: I've deleted one certificate in my keychain that solve the problem for me. It was a certificate which was not trustful. Maybe this will help you.
Note that the "harmful" certificate might not be a development certificate or related to development/provisioning at all. Make sure to check for "Certificates", not just "My certificates" in Keychain. The culprit could be any certificate, like a company-signed SSL certificate etc.

Same Problem. Not happy. I have a hard time believing apple released this in such a state. XCode has crashed at least 25x today on me.

I solved the problem. I don't know if its the best solution, but after five days I'm happy to have Xcode working again.
I solved the problem by doing two things. Resetting my Keychain under Lion and revoking my existing provisioning profiles.
So first, reset your Keychain under Lion (http://support.apple.com/kb/TS1544). This will make the Organizer launch without crashing.
Unfortunately, now you can't deploy your software because you killed all the certs in the keychain. So now you need to revoke all your developer certs (developer.apple.com/membercenter) and delete the provisioning profiles from your Organizer. Then tell the Organizer to refresh.
It will restore all your sick profiles, but will also create at least one healthy one.
The new version of Xcode tries to be helpful, and wants to handle all your cert needs for you. So bring up an Xcode project, and set code signing to the new provisioning profile. Compile, and everything will work again.
As I said, may not be the best solution, but deleting old certs from the Keychain and extra prefs files did nothing to help me. If all else fails, try this recipe and it will probably help.

Finally figured this out. The problem for me was with the my dev device and not XCode. I restored my device to the factory defaults. Now XCode won't crash when the device is plugged in.
Before I reset the device, I tried just deleting all the certificates on the device. However, XCode still crashed. That's the only other step I took on the device before reseting it.
3/22/12 UPDATE: Apple released a new version of XCode today. From the release notes:
Additional bug fixes and stability improvements
Hopefully this fixes the issue for most people.
4/11/12 UPDATE
I started to have issues again with XCode. A colleague suggested I clear out the XCode cache for my project, which was located here for me:
~/Library/Developer/Xcode/DerivedData/your_app_name-abunchofletters
Within that folder run:
rm -r *
XCode no longer crashes when plugging in my dev device.

and again here.. I noticed my iphone would wake up after these crashes - it syncs via wifi.
I thought it fixed the problem yesterday until I started work today.. I can't work like this.. I'm already looking for an alternative.
I can force it to crash Today (for something different from Apple) File > Open > And select the programming folder where all the work is..Boom! Every Time..
Bottom Line: No Apple App release expected Today...

Same here. Check out your the System logs. For me it seems to be a bogus USB connection. I see stuff like that in the logs (console app):
27.02.12 13:34:16,537 com.apple.usbmuxd: _SendAttachNotification (thread 0x7fff756c7960): sending attach for device xxx._apple-mobdev._tcp.local.: _GetAddrInfoReplyReceivedCallback matched.
And then
27.02.12 13:34:20,407 [0x0-0x6b06b].com.apple.dt.Xcode: garbage pointer stored into reachable memory, break on auto_zone_resurrection_error to debug
27.02.12 13:34:20,425 [0x0-0x6b06b].com.apple.dt.Xcode: Xcode(2099,0x114d85000) malloc: * error for object 0x7fef55278cb0: pointer being freed was not allocated
Interestingly right after that tere is a backupd process that tries to start the time machine backup. Maybe related - I'll keep an eye on it.

I tried removing certificates as others have suggested and even reset my Keychain. However this had no affect and opening the organiser always causes a crash/hang.
My fix was to remove some of the Xcode settings files. Specifically I removed the following:
~/Library/Developer/Xcode/UserData/IDEOrganizerWindowController.xcuserstate
~/Library/Developer/Xcode/UserData/IDEPreferencesController.xcuserstate
~/Library/Developer/Xcode/UserData/KeyBindings
The solution to this Xcode problem seems to vary, but I had not seen anyone else post this solution, so I hope it will help others. Remember I had gone through the Keychain reset before getting to this, so I'm not ruling out a keychain reset with this solution.

This isn't a real fix, but if you open up Activity Monitor, filter for bash, and continue to close/force close that process, xCode will regain consciousness.

If above solutions dosen't work then try installing previous version of your xcode using time machine.
Really it worked for, apple updates is creating problem.

I deleted all old certificates which were not trustful. Even after doing so, my Xcode 4.5 crashed while opening organizer.
Hard Resetting the Xcode fixed my problem.
Fire up your terminal.
Type "defaults delete com.apple.Xcode" and press "Enter." This deletes the customized settings set up.
Sometimes if you have more than one version of Xcode installed the defaults bundle identifier could be different. You can check lists of bundles identifiers by allowing terminal to show possibilites by pressing Tab button.
Type "rm -rf ~/Library/Application\ Support/Xcode" and press "Enter." This removes the configuration folders as well.
Now open up an Xcode and it will show you agreement page. In this way my Xcode worked as expected.
I hope it might be help to someone.

I tried all the above and couldn't, the solution I found was really simple:
Go to ~/Library/Developer/ , inside this folder has a folder Xcode, all I did was renaming the existent one and reopen Xcode, then Xcode created a new folder name Xcode and everything started to work again.
Hope that helps.

I had this same error on Xcode 5.0 whenever I went to the Devices tab. The solution was found by looking at Applications->Utilities->Console. It was attempting to write to a read-only device logs database which then meant it couldn't instantiate the object model (ORM) and context for that database. The crash description was "Cannot perform operation without a managed object context".
Removing ~/Library/Developer/Xcode/iOS Device Logs/* and ~/Library/Developer/Xcode/iOS Device Logs*.db meant that it recreated the (now empty) .db file on startup with the right permissions, and everything works fine now.

Related

Xcode Failed to set unique install ID on plugin

While building and running my app I simulator I came across this error
Domain: IXUserPresentableErrorDomain
Code: 1
Failure Reason: Please try again later.
Recovery Suggestion: Failed to set unique install ID on plugin com.myapp.enterprise.MyExtensionEnterprise
User Info: {
DVTErrorCreationDateKey = "2022-03-05 06:33:17 +0000";
IDERunOperationFailingWorker = IDELaunchiPhoneSimulatorLauncher;
}
I am running on Xcode 13.2.1 and on Monterey, Have anyone else seen this before or know how to get around it?
I had a similar issue and found out that the IntentHandler.swift of an Intent Extension wasn't added to the Target Membership. Adding it to the Intent Target Membership fixed the problem.
For me, what worked was to fully remove the applications from both Apple Watch and iPhone simulators, clean the build, and it should start working.
Between recreating the widget extension, deleting derived data, erasing the content on the sim, restarting xcode (so basically standard stuff multiple times), something just clicked for xcode (???) and it started working for me.
My best bet is that what happened was:
Turned on "main app target > Build Phases > Embed App Extensions > Copy only when installing"
Ran the app (this time it was successful, however, the widget was not present)
Turned "main app target > Build Phases > Embed App Extensions > Copy only when installing" back off
However, this is just a wild stab, but it might work for someone else as well.
Good luck!
*forgot to say, mine is an ios widget extension

FileProviderExtension won't be loaded in macOS 12.2

I am new to macOS development.
I am trying to develop macOS FileProvider extension, and everything was fine until I updated my macOS from 11 to 12.2.
After updating OS, FileProvider extension won't being loaded by NSFileProviderManager.add(domain) and its completion handler returns error - NSFileProviderDomain.Error.providerNotFound
#IBAction func tapAddDomainButton(_ sender: Any) {
NSFileProviderManager.add(domain) { error in
print("Error: \(error)") // <- Error: Optional(Error Domain=NSFileProviderErrorDomain Code=-2001 "The application cannot be used right now." UserInfo={NSLocalizedDescription=The application cannot be used right now.})
}
}
I've made a new boilerplate project with default macOS > App + 'File Provider Extension' in Xcode, and still got same error.
Same code works on macOS 11.6.1.
Weird thing is that apple sample code won't return error and still works in macOS 12.2.
I can't find any difference between my code and Apple Sample Code.
I uploaded my test project here.
Please help
Thanks in advance.
Additional info: My colleague tested in macOS 12.0.1/12.1 and my test project works fine.
I encountered the same problem and even opened feedback with apple.
What I figured out (after way too long pulling my hair out) is, as you write, the app group is essential.
But not only that, the Extension Info.plist key "NSExtensionFileProviderDocumentGroup" must correspond to your app group.
I think I managed to this problem.
The key point is AppGroup. FileProvider requires AppGroup capabilities.
I think that a step to reproduce the issue likes below.
Launch provider without AppGroup at first time, and face the FileProvider error.
Add AppGroup capabilities and relaunch.
Still got the error.
New project with adding AppGroup capabilities at first launch won't fail.
I managed to fix it by changing the app and extension group (com.apple.security.application-groups):
From $(APP_TEAM_ID).MyGroup
To group.MyGroup

Prevent or clear app state persistence for MacOS SwiftUI Document Based App

I am developing a MacOS Document based app using SwitfUI on MacOS 12.0.1 using Xcode 13.1 on a MacbookPro M1 Pro. I am encountering an issue that the app is always re-opening the document browser at the last used directory. Which is OK when it is on the Machine but a pain if the last used was on a network drive. I am trying to find a way of suppressing this "always restore using the last directory" mode of operation.
I have tried using the #NSApplicationDelegateAdaptor approach and implementing;
func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
print(#function + " returning false")
return false
}
within my NSApplicationDelegate class, which does get called (although it seems sometimes after the dialog is presented), however this does not stop the app secretly remembering the last directory.
Does any know where this information might be being hidden or if it can be suppressed ?
I have looked for, but cannot find, a way of injecting a starting directory into a DocumentGroup as a possible solution.
TIA Alan.
Ok, for anyone who ends up here looking for a similar issue.
After a chunk of digging I found the answer, for me, was to add
UserDefaults.standard.removeObject(forKey: "NSNavLastRootDirectory")
into the app startup. It was also suggested to do
UserDefaults.standard.removeObject(forKey: "NSNavLastCurrentDirectory")
However, just doing the first appears to suppress the file open dialog, doing both causes the file open dialog to open with the user Documents directory.

Why am I getting the error "Command /usr/bin/codesign failed with exit code 1" in Xcode 6 on Yosemite?

I'm using Xcode 6.1, OS X Yosemite preview 8, and I'm getting the following error on code signing my app:
Command /usr/bin/codesign failed with exit code 1
Reading on Google, it seems to be linked to expired certificates/provisioning profiles. I deleted all of my certificates & profiles, created a new development certificate & profile, installed both, restarted my Mac, and I’m still getting the same error.
Can anyone shed some light on how to resolve this problem?
How about this: Try Xcode -> Preferences -> Accounts -> Choose your account, and then View Details -> Refresh (button on bottom left), Refresh again, restart XCode. Sounds like voodoo but it works for me and my team! (Posting it as answer, because it DOES work, at least sometimes and for some people. Possibly related to the weather ;) )
as of Xcode 6.3.2, here's what I did.
from main project view, click on build settings and in the search bar type in certificate, a code signing tab should pop up, I chose "dont sign code". and it worked
So I've managed to fix the issue for my particular case - in the build settings, instead of automatically detecting the certificate & provisioning profile to use, I manually set them - and it works.
In my case I was getting this error while trying to build a project I downloaded from Github for my own personal use. I just went to the build settings and told it not to sign the code.
Another gotcha I noticed is that codesign will fail if run from an ordinary ssh login session. It has to be run on a MacOSX desktop GUI shell window. This catches me every time, so I've added a line to the build script to print a message about running the script on the MacOSX GUI if codesign fails.
Delete previous provisional profile and add new provisional profile.restart the machine if still its giving an error like above. when your machine shut off then automatically your device asking for permission then select Confirm and run your code....its working.
There appears to be a bug in XCode (I'm using 7.1.1) with returning to "Signing: None" after having attempted to sign with an expired identity, resulting in this codesign error even after you've apparently removed the bad signing identity.
The project.pbxproj file retains TargetAttributes for the expired identity, and Debug and Release settings both continue to show the following instead of the original empty values:
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
This persists after cmd+alt+shift+K and closing XCode. I fixed it with a git reset (if I hadn't committed before attempting to sign, I'm not sure how I would have found this).
I had to delete all my developer certificates from Keychain Access first, then use the Preferences -> Accounts -> View Details -> Download All approach to successfully re-sign my code.

Unable to process application Info.plist validation at this time due to a general / IO error [duplicate]

I am creating a newsstand application. the application is ready, now i am trying to upload the app in apple store using Application Loader. While uploading the zip file its showing the error message as
Unable to process application info.plist validation at this time due to a general error (1095)
I googled this in the net, but did not find the solution still.
This is clearly an Apple server issue, not an Xcode/iOS/OSX issue. Just wait patiently and Apple's servers will catch up to the traffic, or solve whatever issues they're having at their end.
If you're anxious, feel free to just sit there and restart Xcode until it works - but it's not restarting Xcode, only the time you waste that's solving the issue.
While you're waiting, run your apps in Instruments and solve some performance issues ;)
I just had this error. I waited an hour and tried again with the exact same build and it was all good. Vote for it being Apple's temporary glitch.
I had the same problem. I closed Xcode, restart my computer and it worked.
One possible problem to this is corrupted png files. The png files should not be interlaced
I found a solution to the problem.
If you're using Xcode 4+, you don't have to use Application Loader anymore. Instead you should archive your project in Xcode (Product->Archive). It will then open the organizer, where 3 buttons are displayed. Hit the submit button.
If you've created an entry for your app with Itunes Connect, you should be able to choose that from the list, and then select your distribution profile. Then hit the next button, and you should get a message, that tells you, that your app has been submitted.
At least that worked for me.
Use Application Loader.
I'm getting this a lot today.
Application Loader worked.
XCode > Project > Archive
XCode > Organizer > Distribute > Enterprise/add Hoc > Save As
Saves as YOURAPP.ipa.
Make sure Save for Enterprise Deploy remains UNCHECKED.
Download latest Application Loader.
tap 'Deliver Your App'
make sure new version in itunes connect in WAITING FOR UPLOAD state
Click on Activity... button
TIP: open Console.app to see XCode Validation errors
Click on ALL MESSAGE on list of logs on right.
Then in search enter 'XCode' or 'Application Loader'
to monitor any errors with your upload.
Note:
I did all this and still got email about missing 120x120 icons.
Forgot to update them in Build Target > General Tab
List of new icon requirements for iOS7
http://www.icenium.com/resources/forums/icenium-general-discussion/missing-recommended-icon-file
Another reason why this can happen is the duplicate product name. Despite your app names, executable names, display names or bundle IDs are different, if the product name exists in your current apps this error is gonna occur.
"The server returned an invalid response. This may indicate that a network proxy is interfering with communication, or that Apple servers are having issues. Please try your request again later.""
Reset The internet connection.
Reopen the xcode.
Set the profile again.
Clean build.
And Archive the build.
Works perfect for me (With in 5 minutes no need to wait).
Thanks
It's just the time, because you can't control Apple's Server's traffic problem, We all merely become the victim of that..So cut the long story short...
By restarting XCODE may work but everyone as in my case, i tried by restarting XCODE, SYSTEM, ROUTER and anything and everything possible, only error name had changed from "The network connection was lost" to "The request timed out" and vice Versa..!
Just think at what time less people would be accessing the sever...
PS: Only perseverance can help you in this way..keep redialing..And WAIT and WATCH:P
I solved ... :)
Please remove all your icons and splash image also remove icon Files and icons File( IOS 5 ) from info.plist and then add all your icons to app bundle ...
After this update info.plist iconFiles field add desired name of icons....
And last but not least remove Provisioning profile from developer portal and recreate it ...
Clean your build and Archive it and using Application Loader submit it to AppStore ...
it work for me and i think it may help you...
Not every time not it is Apple server issue,sometime we did some bad linking according to me :)

Resources