Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 10 beta error while building my project?

I updated my Xcode to 10 beta after that when I build I am getting bellow error with build failure..

accessing build database "/Users/n/Library/Developer/Xcode/DerivedData/Build/Intermediates/XCBuildData/build.db": database is locked Possibly there are two concurrent builds running in the same filesystem location.

I have my script in Build phases like below

  set -e
  if [ -d "${PROJECT_DIR}/Frameworks" ]; then
  rm -rf "${PROJECT_DIR}/Frameworks"
  fi
  mkdir "${PROJECT_DIR}/Frameworks"
  #FRAMEWORKS_PATH="${PROJECT_DIR}/../Frameworks"
  xcodebuild -project 

  "${PROJECT_DIR}/../iOS/Frameworks/sdk/SDK.xcodeproj" -scheme 
  "SDKAggregate" -sdk "iphoneos" -configuration "Build"

 cp -r 
 ${PROJECT_DIR}/../iOS/Frameworks/sdk/"SDK.framework" 
 "${PROJECT_DIR}/Frameworks"

I FOUND THIS LINK [Xcode 10: unable to attach DB error

But my case is different please help me thanks in advance..

Note: If I choose New build system then only i am getting this error. For Legacy build system everything works fine.

like image 288
tp2376 Avatar asked Feb 04 '23 22:02

tp2376


1 Answers

I found a solution, if you are running your xcodebuild from terminal to an specific target (The Aggregate one) just add the OBJROOT="${OBJROOT}/DependentBuilds" example:

sudo xcodebuild -project YourProject.xcodeproj -target YourProject-Universal -destination "platform=iOS,name=generic/iOS" OBJROOT="${OBJROOT}/DependentBuilds"

I added the sudo to allow Xcode to create the DependentBuilds directory, but you can change your folder permission and it will work.

like image 132
David Cortes Avatar answered Feb 06 '23 13:02

David Cortes