Scanning Objc code failed

Hi sirs,

I encountered a error when I was scanning my code and I got no idea to solve it.

Here is the issue:
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.execute(
    at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(
    at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(
    at org.sonar.core.platform.ComponentContainer.startComponents(
    at org.sonar.core.platform.ComponentContainer.execute(
    at org.sonar.scanner.scan.ProjectScanContainer.scan(
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(
    at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(
    at org.sonar.core.platform.ComponentContainer.startComponents(
    at org.sonar.core.platform.ComponentContainer.execute(
    at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(
    at org.sonar.core.platform.ComponentContainer.startComponents(
    at org.sonar.core.platform.ComponentContainer.execute(
    at org.sonar.batch.bootstrapper.Batch.doExecute(
    at org.sonar.batch.bootstrapper.Batch.execute(
    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(
    at java.base/java.lang.reflect.Method.invoke(
    at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(
    at com.sun.proxy.$Proxy0.execute(Unknown Source)
    at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(
    at org.sonarsource.scanner.api.EmbeddedScanner.execute(
    at org.sonarsource.scanner.cli.Main.execute(
    at org.sonarsource.scanner.cli.Main.execute(
    at org.sonarsource.scanner.cli.Main.main(
    ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

Here is the terminal info when I build the “build-wrapper”:
➜ ~ /Users/yukaichang/build-wrapper-macosx-x86/build-wrapper-macosx-x86 --out-dir /Users/yukaichang/build-wrapper-macosx-x86 xcodebuild clean build
dyld: warning: could not load inserted library ‘/Users/yukaichang/build-wrapper-macosx-x86/libinterceptor.dylib’ into hardened process because no suitable image found. Did find:
/Users/yukaichang/build-wrapper-macosx-x86/libinterceptor.dylib: code signature in (/Users/yukaichang/build-wrapper-macosx-x86/libinterceptor.dylib) not valid for use in process using Library Validation: mapping process is a platform binary, but mapped file is not
/Users/yukaichang/build-wrapper-macosx-x86/libinterceptor.dylib: stat() failed with errno=1
xcodebuild: error: The directory /Users/yukaichang does not contain an Xcode project.

And then “build-wrapper-dump.json” is generated. JSON file’s content is as below:

Is it caused by the “build-wrapper-dump.json” is empty or there is another reason?
version information:
SonarQube: developer 8.4.2
SornaScanner: 4.4.0 macosx
Build Wrapper: 6.11

Could anyone help me to figure out? Thank you in advance.

Hello @AndyChang,
Welcome to the community.
The analysis is failing because the command you are passing to build-wrapper is failing; it doesn’t build your project.

You don’t have xcode project so why are you passing xcodebuild to build-wrapper.
To make analysis work:
1- Figure out how to clean build your project from the command line without build-wrapper.
2- Pass the build command to build-wrapper:

build-wrapper-macosx-x86 --out-dir /Users/yukaichang/build-wrapper-macosx-x86 replace_this_by_clean_build_command_that_build_your_project_succefully_without_build_wrapper

3- The previous command should build your project from scratch successfully and the build-wrapper.json should not be empty


1 Like

Hi @Abbas_Sabra,

Thank you for the reply!
Seems I made some mistakes with build-wrapper process.
I will follow the your steps and figure out right command to build the project.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.