# The “build-wrapper-dump.json” file was found empty with xcodebuild

**URL:** <https://community.sonarsource.com/t/the-build-wrapper-dump-json-file-was-found-empty-with-xcodebuild/105916>\
**Category:** SonarQube Server / Community Build\
**Tags:** cfamily, scanner\
**Created:** [December 13, 2023, 2:14am UTC](https://community.sonarsource.com/t/the-build-wrapper-dump-json-file-was-found-empty-with-xcodebuild/105916 "2023-12-13T02:14:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Take](https://avatars.discourse-cdn.com/v4/letter/t/e79b87/32.png) [@Take](https://community.sonarsource.com/u/Take)\
**Post date:** [December 13, 2023, 2:14am UTC](https://community.sonarsource.com/t/the-build-wrapper-dump-json-file-was-found-empty-with-xcodebuild/105916/1 "2023-12-13T02:14:46Z")

</div>

Must-share information (formatted with [Markdown](https://commonmark.org/help/)):

- which versions are you using  
SonarQube-10.2.1.78527,  
build-wrapper-macosx-x86,  
sonar-scanner-5.0.1.3006-macosx,  
M2 macOS sonoma 14.1.1

- how is SonarQube deployed: GCP

- what are you trying to achieve  
Execute analysis by sonarscanner and send the analysis results to sonarqube, which is located on GCP.

- what have you tried so far to achieve this  
Verify that the clean build succeeds with the command “xcodebuild -workspace \*\* -scheme \*\*”.  
But that the command “build-wrapper-macosx-x86 --out-dir build\_wrapper\_output\_directory xcodebuild -workspace \*\* -scheme \*\*” and "sonar-scanner   
-Dsonar \*\*"gets the following error and ends in analysis failure.

**Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!**

```auto
INFO: 0/1172 files marked as unchanged
INFO: Cache: 0/0 hits, 125 bytes
INFO: 0 compilation units analyzed
DEBUG: the bridge server will shutdown
DEBUG: the bridge server closed
INFO: Time spent writing ucfgs 6ms
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 1:40.127s
INFO: Final Memory: 59M/234M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: The "build-wrapper-dump.json" file was found empty. Please make sure that:
* you are using the latest version of the build-wrapper and the CFamily analyzer
* your compiler is supported
* you are wrapping your build correctly
* you are wrapping a full/clean build
* if you are building your project inside a Docker container, build-wrapper is wrapping the build process inside the container and not wrapping the external Docker process

at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:602)
at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:241)
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:88)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:64)
at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:82)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:398)
at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:394)
at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:363)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:139)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:71)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:65)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at jdk.proxy1/jdk.proxy1.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
at org.sonarsource.scanner.cli.Main.execute(Main.java:126)
at org.sonarsource.scanner.cli.Main.execute(Main.java:81)
at org.sonarsource.scanner.cli.Main.main(Main.java:62)

```

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [December 15, 2023, 2:11pm UTC](https://community.sonarsource.com/t/the-build-wrapper-dump-json-file-was-found-empty-with-xcodebuild/105916/2 "2023-12-15T14:11:17Z")

</div>

Hey there.

It sounds like you have the process right. Can you zip up your build-wrapper output directory and share it?

---

<div class="post-metadata">

**Author:** ![Take](https://avatars.discourse-cdn.com/v4/letter/t/e79b87/32.png) [@Take](https://community.sonarsource.com/u/Take)\
**Post date:** [December 20, 2023, 4:47pm UTC](https://community.sonarsource.com/t/the-build-wrapper-dump-json-file-was-found-empty-with-xcodebuild/105916/3 "2023-12-20T16:47:32Z")

</div>

Thanks for your help.  
The build-wrapper output directory contains two files.Personal data are Masked.  
build-wrapper-dump/json

```auto
{
"version":"6.48.1",
"captures":[
]}

```

build-wrapper.log

```auto
***00:18 2023: build-wrapper, version 6.48.1 (macosx-x86)
***00:18 2023: System name: Darwin Nodename:***.local Release: 23.1.0 Version: Darwin Kernel Version 23.1.0: Mon Oct 9 21:28:31 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T8112 Machine: x86_64
***00:18 2023: socket path: /tmp/build-wrapper-socket.qutP2k
***00:18 2023: dynamic library found:**** /build-wrapper-macosx-x86/libinterceptor.dylib
***00:18 2023: cwd: <*** >
***00:18 2023: command executed as: <build-wrapper-macosx-x86 --out-dir build_wrapper_output_directory>
***00:18 2023: out-dir absolute path: <*** /build_wrapper_output_directory>
***00:18 2023: command line received: <xcodebuild -destination generic/platform=iOS -workspace***.xcworkspace -scheme ***CODE_SIGN_STYLE=Manual PRODUCT_BUNDLE_IDENTIFIER=*** IPHONEOS_DEPLOYMENT_TARGET=12.0 DEVELOPMENT_TEAM= ***CODE_SIGN_IDENTITY=*** PROVISIONING_PROFILE_SPECIFIER=*** clean build>
***00:18 2023: env 0: <MANPATH=/opt/homebrew/share/man::>
***00:18 2023: env 1: <TERM_PROGRAM=Apple_Terminal>
***00:18 2023: env 2: <PYENV_ROOT=*** /.pyenv>
***00:18 2023: env 3: <TERM=xterm-256color>
***00:18 2023: env 4: <SHELL=/bin/zsh>
***00:18 2023: env 5: <HOMEBREW_REPOSITORY=/opt/homebrew>
***00:18 2023: env 6: <TMPDIR=/var/folders/gc/c5r9bdz50jn63gvjxsx3xbch0000gn/T/>
***00:18 2023: env 7: <CONDA_SHLVL=1>
***00:18 2023: env 8: <CONDA_PROMPT_MODIFIER=(base) >
***00:18 2023: env 9: <TERM_PROGRAM_VERSION=452>
***00:18 2023: env 10: <OLDPWD=*** /cicd>
***00:18 2023: env 11: <TERM_SESSION_ID=*** >
***00:18 2023: env 12: <USER=*** >
***00:18 2023: env 13: <CONDA_EXE=*** /anaconda3/bin/conda>
***00:18 2023: env 14: <SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.aWadcIqNo9/Listeners>
***00:18 2023: env 15: <_CE_CONDA=>
***00:18 2023: env 16: <PATH=*** /anaconda3/bin: ***/anaconda3/condabin:*** /.rbenv/shims: ***/.rbenv/bin:*** /.pyenv/shims: ***/.pyenv/bin:*** /.pyenv/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin: ***/cicd/sonar-scanner-5.0.1.3006-macosx/bin:*** /cicd/build-wrapper-macosx-x86>
***00:18 2023: env 17: <CONDA_PREFIX=*** /anaconda3>
***00:18 2023: env 18: <__CFBundleIdentifier=com.apple.Terminal>
***00:18 2023: env 19: <PWD=*** >
***00:18 2023: env 20: <LANG=ja_JP.UTF-8>
***00:18 2023: env 21: <XPC_FLAGS=0x0>
***00:18 2023: env 22: <RBENV_SHELL=zsh>
***00:18 2023: env 23: <_CE_M=>
***00:18 2023: env 24: <XPC_SERVICE_NAME=0>
***00:18 2023: env 25: <PYENV_SHELL=zsh>
***00:18 2023: env 26: <HOME=*** >
***00:18 2023: env 27: <SHLVL=2>
***00:18 2023: env 28: <HOMEBREW_PREFIX=/opt/homebrew>
***00:18 2023: env 29: <CONDA_PYTHON_EXE=*** /anaconda3/bin/python>
***00:18 2023: env 30: <LOGNAME=*** >
***00:18 2023: env 31: <CONDA_DEFAULT_ENV=base>
***00:18 2023: env 32: <INFOPATH=/opt/homebrew/share/info:>
***00:18 2023: env 33: <HOMEBREW_CELLAR=/opt/homebrew/Cellar>
***00:18 2023: env 34: <_=*** /build-wrapper-macosx-x86/build-wrapper-macosx-x86>
***00:18 2023: executing: <xcodebuild -destination generic/platform=iOS -workspace***.xcworkspace -scheme ***CODE_SIGN_STYLE=Manual PRODUCT_BUNDLE_IDENTIFIER=*** IPHONEOS_DEPLOYMENT_TARGET=12.0 DEVELOPMENT_TEAM= ***CODE_SIGN_IDENTITY=*** PROVISIONING_PROFILE_SPECIFIER=*** clean build>
***00:18 2023: initializing json file
***00:18 2023: process created with pid: 77056
***00:18 2023: parent pid: 77054
***00:18 2023: working directory: <*** >
***00:18 2023: executable: <*** >
***00:18 2023: argv[0]: <build-wrapper-macosx-x86>
***00:18 2023: argv[1]: <-c>
***00:18 2023: argv[2]: <>
***00:18 2023: argv[3]: <xcodebuild>
***00:18 2023: argv[4]: <-destination>
***00:18 2023: argv[5]: <generic/platform=iOS>
***00:18 2023: argv[6]: <-workspace>
***00:18 2023: argv[7]: <******.xcworkspace>
***00:18 2023: argv[8]: <-scheme>
***00:18 2023: argv[9]: <***>
***00:18 2023: argv[10]: <CODE_SIGN_STYLE=Manual>
***00:18 2023: argv[11]: <PRODUCT_BUNDLE_IDENTIFIER=***>
***00:18 2023: argv[12]: <IPHONEOS_DEPLOYMENT_TARGET=12.0>
***00:18 2023: argv[13]: <DEVELOPMENT_TEAM=***>
***00:18 2023: argv[14]: <CODE_SIGN_IDENTITY=***>
***00:18 2023: argv[15]: <PROVISIONING_PROFILE_SPECIFIER=***>
***00:18 2023: argv[16]: <clean>
***00:18 2023: argv[17]: <build>
***00:18 2023: skipping process with pid: 77056
***00:18 2023: process created with pid: 77057
***00:18 2023: parent pid: 77056
***00:18 2023: working directory: <*** />
***00:18 2023: executable: </private/tmp/sonarsource-build-wrapper-cache-501/usr/bin/xcodebuild>
***00:18 2023: argv[0]: <xcodebuild>
***00:18 2023: argv[1]: <-destination>
***00:18 2023: argv[2]: <generic/platform=iOS>
***00:18 2023: argv[3]: <-workspace>
***00:18 2023: argv[4]: <******.xcworkspace>
***00:18 2023: argv[5]: <-scheme>
***00:18 2023: argv[6]: <***>
***00:18 2023: argv[7]: <CODE_SIGN_STYLE=Manual>
***00:18 2023: argv[8]: <PRODUCT_BUNDLE_IDENTIFIER=***>
***00:18 2023: argv[9]: <IPHONEOS_DEPLOYMENT_TARGET=12.0>
***00:18 2023: argv[10]: <DEVELOPMENT_TEAM=***>
***00:18 2023: argv[11]: <CODE_SIGN_IDENTITY=***>
***00:18 2023: argv[12]: <PROVISIONING_PROFILE_SPECIFIER=***>
***00:18 2023: argv[13]: <clean>
***00:18 2023: argv[14]: <build>
***00:18 2023: skipping process with pid: 77057
***01:35 2023: finalizing json file
***01:35 2023: returned with code: 0

```

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [December 21, 2023, 6:48pm UTC](https://community.sonarsource.com/t/the-build-wrapper-dump-json-file-was-found-empty-with-xcodebuild/105916/4 "2023-12-21T18:48:09Z")

</div>

Thanks.

It doesn’t look like `xcodebuild` is _doing_ all that much (like compiling code). Do you expect to analyze C/C++/Objective-C files, or, for example, only Swift files (in which case the build wrapper is not needed)?

---

<div class="post-metadata">

**Author:** ![Take](https://avatars.discourse-cdn.com/v4/letter/t/e79b87/32.png) [@Take](https://community.sonarsource.com/u/Take)\
**Post date:** [December 22, 2023, 12:26am UTC](https://community.sonarsource.com/t/the-build-wrapper-dump-json-file-was-found-empty-with-xcodebuild/105916/5 "2023-12-22T00:26:02Z")

</div>

My project uses obejective-c and swift.So I believe that build wrapper is necessary.

---

<div class="post-metadata">

**Author:** ![mpaladin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/mpaladin/32/118_2.png) [@mpaladin](https://community.sonarsource.com/u/mpaladin)\
**Post date:** [December 22, 2023, 2:02pm UTC](https://community.sonarsource.com/t/the-build-wrapper-dump-json-file-was-found-empty-with-xcodebuild/105916/9 "2023-12-22T14:02:00Z")

</div>

Hi @Take ,

I am sending you a private message where I can collect more information about your project.

---

<div class="post-metadata">

**Author:** ![mpaladin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/mpaladin/32/118_2.png) [@mpaladin](https://community.sonarsource.com/u/mpaladin)\
**Post date:** [February 2, 2024, 3:22pm UTC](https://community.sonarsource.com/t/the-build-wrapper-dump-json-file-was-found-empty-with-xcodebuild/105916/15 "2024-02-02T15:22:21Z")

</div>

Hi @Take ,

to sum up our private conversation, the build-wrapper is not able to capture the compiler invocations from Xcode 15, I created a ticket for that: [[CPP-4941] - Jira](https://sonarsource.atlassian.net/browse/CPP-4941).

We plan to solve that throughout the year. In the meantime, the compilation database can be used to run the analysis, instructions provided in the ticket.

For more information about the compilation database, please refer to the SonarQube documentation:

> **[C/C++/Objective-C](https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/languages/c-family/#using-compilation-database)**
>
> C/C++/Objective-C analysis is available starting in Developer Edition.

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [May 20, 2025, 3:34pm UTC](https://community.sonarsource.com/t/the-build-wrapper-dump-json-file-was-found-empty-with-xcodebuild/105916/19 "2025-05-20T15:34:11Z")

</div>

Hey @Take,

If you didn’t see – last year we introduced support in SonarQube Server for a feature called C/C++ AutoConfig! Removing the question of using a compilation database altogether.

> [@C and C++ AutoConfig for SonarQube](https://community.sonarsource.com/t/c-and-c-autoconfig-for-sonarqube/117344):
>
> We have big news for our dear C and C++ SonarQube users. Configuring the analysis requires some skills; at times, it can get technical and tedious, with a few known caveats. We unleashed the talent of our mighty engineers, and they made our C and C++ analyzer smart enough to configure itself. Hence the name AutoConfig. As a result: No need to worry about compiler support No need to worry about build-wrapper or compilation database No need to know anything about the project to configure, nor C…

This is available in SonarQube Server _v10.6+_, although you should really target at least _v2025.1_.

All said, you can continue to reference the workaround in the ticket Massimo mentioned.
