Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 11 GM - error: accessing build database - disk I/O error

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"?

like image 435
lal Avatar asked Sep 16 '19 21:09

lal


2 Answers

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)

like image 58
lal Avatar answered Nov 15 '22 04:11

lal


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

Adding:

 OBJROOT="${OBJROOT}/DependentBuilds"
like image 45
Ly Kun Avatar answered Nov 15 '22 04:11

Ly Kun