9

Encountering following error when only building a "Universal Binary Framework" for release distribution. Same project and settings works when building "Non-Universal" scheme in debug or release mode.

Project uses Objective-C & Xcode 11 GM (11A419c). Now, updating to Xcode 11 GM Seed 2 (11A420a).

error: accessing build database "/Users/john.doe/Library/Developer/Xcode/DerivedData/FrameworkSDK-esxhqchxkdevuiapyebthsdscpje/Build/Intermediates.noindex/XCBuildData/build.db": disk I/O error

Using following build command from a script:

xcodebuild -workspace ${PROJECT_NAME}.xcworkspace -scheme ${PROJECT_NAME} -sdk iphonesimulator -configuration ${CONFIGURATION} only_active_arch=no defines_module=yes clean build CONFIGURATION_BUILD_DIR=${BUILD_DIR}/${CONFIGURATION}-iphonesimulator 2>&1

Tried a few steps: Complete clean, pod update and steps mentioned on Related error for Xcode 10 & linked post - Doesn't solve this issue

No Answer on this question:
why error "accessing build database disk I/O error"?

pkamb
  • 33,281
  • 23
  • 160
  • 191
lal
  • 7,410
  • 7
  • 34
  • 45
  • What version of Xcode? 11A420a? – Rob Sep 17 '19 at 00:35
  • Those .db files are sqlite databases. Can you access them without I/O errors, using the sqlite3 command? – Gereon Sep 17 '19 at 05:16
  • Happens also for me with the latest Xcode11 GM2 seed (11A420a). I have added some echo-commands in my "run script" build phase to see the root cause of this. The interesting point is, that the script runs trough successfully, but the build still fails because of the mentioned `...Intermediates.noindex/XCBuildData/build.db": disk I/O error` No clue, how to fix this. – AxM Sep 17 '19 at 09:37
  • It was using GM Seed 1 (11A419c). Now, updating to Xcode 11 GM Seed 2 (11A420a), released on Sept 16, 2019. – lal Sep 17 '19 at 17:10
  • Restarting Xcode solved it. – Mantoska Mar 10 '21 at 11:22

3 Answers3

2

In case someone is still stuck here. I follow This Answer and get rid the disk I/O error.

Adding:

 OBJROOT="${OBJROOT}/DependentBuilds"
Damini Suthar
  • 1,470
  • 2
  • 14
  • 43
Ly Kun
  • 41
  • 8
1

Use Command Line Tools for Xcode 11

Ensuring that correct version of Command Line Tools (xcodebuild) is used works with complete clean & building universal framework fresh. And the project is using New Build System (Default). It also worked with Xcode 11 GM - Build 11A419c (seed 1).

Use following command to ensure proper link:

xcodebuild -version
Xcode 11.0
Build version 11A419c

Correct version of Command Line Tools

Earlier it was using the old Xcode10.2 xcodebuild.

Alternative workaround(s)

Not a good fix as it usages Legacy Build System instead of modern system with Xcode 11.

  1. One option is to use Legacy Build System with Shared Project Settings when for universal framework projects.

    Shared Project Settings

  2. Tried using undocumented xcodebuild parameter -UseModernBuildSystem=NO, it didn't work. [working on command line fix, will update]

Relevant release note: for GM-2 seed: Released September 16, 2019 Build 11A420a

An XCFramework makes it possible to bundle a binary framework or library for multiple platforms —including iOS devices, iOS simulators, and Mac Catalyst — into a single distributable .xcframework bundle that your developers can use within their own applications. An .xcframework bundle can be added to an Xcode target’s Link Libraries phase and Xcode uses the right platform’s version of the included framework or library at build time. Creation of frameworks is supported from the command line using xcodebuild -create-xcframework. Frameworks or libraries bundled in an XCFramework should be built with the Build Libraries for Distribution build setting set to YES. (49948269)

Community
  • 1
  • 1
lal
  • 7,410
  • 7
  • 34
  • 45
  • using -UseModernBuildSystem=NO is no more a solution with xcode 12 as legacy build system is deprecated in xcode 12. – Max Oct 23 '20 at 17:36
0

I have the same problem when building our project with XCode 14.1. I added "-derivedDataPath ../derived_data" to the build command and it build without any issue. Hope this can help.


   xcodebuild -sheme YourSheme -project YourProject.xcodeproj -sdk iphoneos -configuration YourConfiguration -derivedDataPath ../derived_data clean build"

Hula
  • 51
  • 3