Same problem as here (Can't archive anymore, yet "build for archive" still works (Xcode 4)). However, the fixes suggested didn't work. I don't know why. Here are the steps I went through:
I would also add, it runs fine in the simulator, but no longer builds and runs for an attached device. The build says Failed, No Issues.
Does anyone have an idea?
OK, I got it! After trying all kinds of things throughout forums, I was answering a related question in the Apple Developer Forum, and that forced me to go back and look at my Entitlements.plist file. For some reason it was empty. I deleted and recreated it, set my allow debugging to NO, and it built just fine.
Don't know why Entitlements got wiped, but hopefully that saves others the hair-pulling I just went through!