24

Hello I have a script to create a universal framework on Xcode 10. When I run it from Xcode everything works fine but if I tried from command line tool I receive the following error:

Build system information
error: error: accessing build database "/path/build.db": disk I/O error

Does anybody face a similar issue?

David Cortes
  • 535
  • 4
  • 14
  • Did you try searching? I see a number of possibly helpful posts. For example https://stackoverflow.com/questions/51153525/xcode-10-unable-to-attach-db-error – matt Aug 14 '18 at 23:14
  • Hey @matt yes I already tried those solutions and still have the problem – David Cortes Aug 14 '18 at 23:20
  • Ok, thanks, just checking! – matt Aug 14 '18 at 23:59
  • I just ran into this with the production build. I built again, and now it works... ? "Build failed. Error accessing build database. (dir) Not an error." I didn't change anything that I'm aware of – Stephen J Oct 05 '18 at 17:25
  • Hey David, did you get a solution for this issue? I am facing similar issue, but none of the solutions on the other link appear relevant to me. – Harish J Dec 03 '18 at 16:33
  • hey @HarishJ at the end I changed my xcodebuild command to this way: sudo xcodebuild -project YourProject.xcodeproj -target YourProject-Universal -destination "platform=iOS,name=generic/iOS" OBJROOT="${OBJROOT}/DependentBuilds" using this form it will work – David Cortes Dec 04 '18 at 19:43
  • Check my answer [https://stackoverflow.com/questions/51153525/xcode-10-unable-to-attach-db-error/54021423#54021423](https://stackoverflow.com/questions/51153525/xcode-10-unable-to-attach-db-error/54021423#54021423) if you want to keep the modern build system without overriding the OBJROOT variable or using the `sudo` – Delfín Jan 03 '19 at 11:31
  • @Delfín thanks will check it out!! – David Cortes Apr 02 '19 at 20:19

1 Answers1

12

I finally found the solution for this one :)

When you build the "Aggregated Target", i.e. the target that contains the script with the:

lipo -create -output ...

you need to run the xcodebuild command with -UseModernBuildSystem=NO

For example:

xcodebuild -target OBFramework -UseModernBuildSystem=NO
Oded Regev
  • 4,065
  • 2
  • 38
  • 50
  • 1
    Does it use the legacy build system instead? Is it a workaround? – allenlinli Sep 17 '19 at 09:47
  • 3
    with xcode 12 legacy build system is deprecated so this workaround does not really work anymore. Any other suggestions @Oded Regev – Max Oct 23 '20 at 16:41