fastlane/fastlane

Fastlane is not reading macros from Package.Swift (SPM)

ykhandelwal913 opened this issue · 1 comments

New Issue Checklist

Issue Description

Fastlane is not reading macros from Package.Swift (SPM) of Firebase. This results in build failure. No issue when trying to archive from Xcode.

Firebase ticket which is related to this issue- firebase/firebase-ios-sdk#6741

error: call to undeclared function 'pb_release'; ISO
C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
pb_release(gdt_client_metrics_ClientMetrics_fields, &clientMetricsProto);

The following build commands failed:
CompileC /Users/xxxxx/test/iOS/output/aws/Build/Intermediates.noindex/GoogleDataTransport.build/Debug-iphoneos/GoogleDataTransport.build/Objects-normal/arm64/GDTCORMetrics+GDTCCTSupport.o /Users/xxxxx/test/iOS/output/aws/SourcePackages/checkouts/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/GDTCORMetrics+GDTCCTSupport.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'GoogleDataTransport' from project 'GoogleDataTransport')

Command executed

bundle exec fastlane build_for_testing

Complete output when running fastlane, including the stack trace and command used
 [REPLACE THIS WITH YOUR INFORMATION] 

Environment

 [REPLACE THIS WITH YOUR INFORMATION] 

Hello,

The issue you’re encountering with Fastlane not reading macros from Package.swift of Firebase, resulting in a build failure, seems to be a known issue. The error message about the undeclared function pb_release indicates that the protobuf C functions are not being correctly imported or recognized during the build process when using Fastlane, even though it works fine when archiving from Xcode.

Here are some steps you can take to troubleshoot and potentially resolve this issue:

Update Fastlane: Ensure that you are using the latest version of Fastlane, as updates often include bug fixes and improvements.
Check Firebase SDK Issue: Review the related Firebase iOS SDK issue #6741 for any updates or suggested fixes.
Explicitly Include Protobuf: If the issue is related to the protobuf functions, make sure that the protobuf library is correctly linked and that any necessary flags are included in the Fastlane build settings.
Review Build Settings: Compare the build settings in Xcode with those used by Fastlane. There might be some project-specific settings in Xcode that are not being applied when building with Fastlane. blue cross blue shield of florida
Clear Derived Data: Sometimes, clearing the derived data can resolve unexpected build issues. You can do this by running the following command:

rm -rf ~/Library/Developer/Xcode/DerivedData

Reset Package Caches: If there’s a caching issue with Swift Package Manager, you can reset the package caches in Xcode by going to File > Swift Packages > Reset Package Caches.

I hope my suggestion is helpful for you. If you want more details please tell me.

Best Regard,
diana658h