Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Occasionally seeing error building using xcodebuild

Tags:

xcode

ios

occasionally we are seeing the following "error" when building our iOS app on the command line:

2014-04-09 13:23:35.393 xcodebuild[2872:3d2f] DeveloperPortal: Using pre-existing current store at URL (file:///Users/build/Library/Developer/Xcode/DeveloperPortal%205.0.2.db).

The reason I put the word "error" in quotes is because the build doesn't seem to fail when we see this happen. It is causing an issue because our automated build sees this message on stderr and treats it as a build failure. If I modify our build tool to ignore this specific message, then I have been able to test the build thus generated and it seems to be ok.

I'm really looking for some kind of idea as to why this message is happening and how to stop it.

Things that I've tried:

  1. google the message above - a few hits, but nothing providing insight
  2. delete the "DeveloperPortal" file - the file is created automatically with the next build and the same error message appears
  3. clear xcode cache (How to Empty Caches and Clean All Targets Xcode 4) - the error still occurs
  4. clean xcode DerivedData folder (http://useyourloaf.com/blog/2011/09/14/xcode-4-deriveddata-and-cleaning-the-build-directory.html) - the error still occurs

thanks

like image 702
1800 INFORMATION Avatar asked Apr 09 '14 01:04

1800 INFORMATION


2 Answers

I have no definite solution for your question but it is likely that one of the following will solve your problem:

  1. You seem to have an old version of Xcode as the developer directory is not located in the Xcode.app directory. Try updating to the newest version of Xcode (I think it's 5.1).

  2. If you cannot update as you do not have the OS version requirements (10.9 Mavericks), try reinstalling the newest version available to you through the Mac App Store (or just run a software update on your Mac(s)).

  3. Try cleaning the project your working on. Sometimes faulty builds can stick and provide errors in newer builds. (Product->Clean)

  4. Try restarting your Mac(s). You have probably already tried this one.

  5. Your error appears to be related to the Developer Portal. Try resigning in to your Developer account.

  6. Final Solution: Troubleshooting

    • Try building another project on the same developer ID and see if you get the error.
    • Try building another project on a different developer ID (or none at all) and see if you get the error.
    • Try building the same project on the same developer ID but on a different Mac.
    • Try building the same project on a different developer ID.

From the results above, you should be able to work out what is causing the problem. The Mac, the developer account or the project itself...

Hope this helps,

Rodit

like image 137
rodit Avatar answered Sep 19 '22 13:09

rodit


I dont personally develop for the AppStore so my advice probably isn't perfect, but maybe I can help.

First I would try making sure your project settings have been updated to Xcode 5.1 (assuming this project was created under an earlier version of Xcode since the db file is called DeveloperPortal 5.0.2.db).

If your project is already updated to 5.1 then I would still audit both the project and the target build settings, specifically for anything with a non-default path.

Maybe an interim solution for you would be to add a shellscript build phase to the problematic target to check for that file and delete it before the rest of the build (so make it step one in the build phases).

Also what happens if you build from within Xcode.app instead of via xcodebuild CLI (on the same promlematic machine)? if it doesnt have the problem maybe post your exact build command and compare it with the build commands issued by Xcode.app.

like image 39
Brad Allred Avatar answered Sep 22 '22 13:09

Brad Allred