Build Failed with error library not found for -lpods

Template for a good bug report, formatted with Markdown:

  • versions used
    SonarQube - 8.4.1,
    Scanner - 4.4.0.2170-macosx

  • error observed
    ld: library not found for -lPods-OneSignalNotificationServiceExtension
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

**** BUILD FAILED ****

The following build commands failed:
/build/Release-iphoneos/OneSignalNotificationServiceExtension.appex/OneSignalNotificationServiceExtension normal arm64

(1 failure)

  • steps to reproduce
    Installed SonarQube and Sonar Scanner and build_wrapper_output_directory in the root directory. Ran the build out command:
    /sonarqube/sonarqube-8.4.1.35646/bin/build-wrapper-macosx-x86/build-wrapper-macosx-x86 --out-dir build_wrapper_output_directory xcodebuild clean build

  • potential workaround
    When I build in XCode it is succeded but it failed in SonarQube Build Wrapper.

Any help would be appreciated.

Hi @Manjula_Nangunuri,

are you able to build successfully the project using xcodebuild clean build command without build-wrapper?

in XCode App I was able to run the Clean Build Folder and Build commands and they both are successful.
In the SonarQube this is the command I ran:
/sonarqube/sonarqube-8.4.1.35646/bin/build-wrapper-macosx-x86/build-wrapper-macosx-x86 --out-dir build_wrapper_output_directory xcodebuild clean build
and I got the Build Failed error shown above.

Hi @Manjula_Nangunuri,

and, if you run only xcodebuild clean build what do you get?

i ran xcodebuild clean build and got the same error:
Clean Build succeeded but Build Failed with the error:

ld: library not found for -lPods-OneSignalNotificationServiceExtension

clang: error: linker command failed with exit code 1 (use -v to see invocation)

**** BUILD FAILED ****

The following build commands failed:

Ld /Users/manjulanangunuri/Desktop/NLEC/Apps/PCO-CLS/build/Release-iphoneos/OneSignalNotificationServiceExtension.appex/OneSignalNotificationServiceExtension normal arm64

Hi @Manjula_Nangunuri,

Then make sure you can properly build your project from command line, you probably need to pass extra arguments to xcodebuild clean build command to get the same you are getting in Xcode.

I’ve installed Command Line tool and ran a Clean Build for all Schemes and they all succeded just like XCode. Please see the image below:

Hi @Manjula_Nangunuri,

did you figure out how to properly build your project?