The "build-wrapper-dump.json" file was found empty. (Project with mixed ObjC and Swift)

Hello Community!

I’m facing a problem after running sonar-scanner. I’ve searched here topics related to my issue but solutions don’t seem apply to my case.

My problem seems to be the same as this post but I could not get enough information about the solution:

I am new to SonarQube and would like to ask for help from anyone here. :slight_smile:

Btw, initially, it was working fine when scanning only for Swift as I forgot to include to scan Objective C files as well.

Must-share information (formatted with Markdown):

Which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)

  1. SonarQube
  2. SonarScanner
  3. BuildWrapper 6.20.3

What are you trying to achieve
I’m trying to scan my project with mixed objective c and swift languages.

What have you tried so far to achieve this

1.Ran build_wrapper command below:

build-wrapper-macosx-x86 --out-dir bw-output xcodebuild clean
  1. Ran code below:

I’ve attached my, build-wrapper-dump.json and screen shot of build-wrapper.log (1016.0 KB)

P.S. I had to cover some paths and remove project names due to privacy.

I got The main branch has no lines of code. warning/error after adding the following in my


Can anyone help know what I did wrong or what I’m missing?

Hey there.

Before any further troubleshooting, I think it’s important that you address the version of the build wrapper you’re using.

This is the version that came bundled with SonarQube v8.9 LTS, not v9.6 (which should be 6.36).

Can you make sure you’re using the version of the build wrapper offered by your current SonarQube server, and see if the build wrapper output changes?

Hey @Colin

Thanks for your reply!

Sorry, I wrote the wrong version I am using here.

My build wrapper version is 6.36 (macosx-x86)

I am not getting “build-wrapper-dump.json” file was found empty anymore.
However, I have another problem now. My project on SonarQube says my main branch doesn’t have lines of code:

My configs are still the same.

I don’t understand why and what I’m missing.

Do you scanner logs show that files are being indexed (and not somehow excluded)? Are any other branches being analyzed under this project?


I don’t think there’s anything being scanned.

This is the screenshot of my sonar-properties (i had to remove names and ids)

Your inclusion is configured to only analyze files in the directory from which the scan is launched. You would need to change it to sonar.inclusions=**/*.swift for example.


Thanks! That fix it!

Now I’m getting errors with commands i tried:

  1. build_wrapper_output_directory
    build-wrapper-macosx-x86 --out-dir build_wrapper_output_directory xcodebuild clean build
    SwiftGeneratePch normal arm64 Compiling\ bridging\ header (in target ‘myApp’ from project ‘myApp’)

  2. bw-output
    I can successfully run command above but I get error after I ran sonar-scanner
    build-wrapper-macosx-x86 --out-dir bw-output xcodebuild clean
    java.lang.IllegalStateException: java.nio.file.NoSuchFileException: /mypath/bw-output/build-wrapper-dump.json

My understanding is build-wrapper-dump.json will be generated at the end of the build. Is it correct?