Build failure: Undefined symbols for x86_64 architecture in HCaptcha 2.9.3
Bug description
Build failure with HCaptcha 2.9.3 when used as transitive dependency through RevolutPayments/RevolutPay pod. The build succeeds with HCaptcha 2.9.2.
To Reproduce
- Create a new iOS project
- Add pod 'RevolutPayments/RevolutPay', '3.6.0' to Podfile
- Run pod install
- Build the project
- Observe build failure with linker error
Error Log
Undefined symbols for architecture x86_64: "_$s8HCaptchaAAC6apiKey010passiveApiC07baseURL6locale4size11orientation5jsSrc6rqdata6sentry8endpoint9reportapi9assethost7imghost4host5theme11customTheme13diagnosticLogABSSSg_Sb10Foundation0G0VSgAU6LocaleVSgAA0A4SizeOAA0A11OrientationOAwTSbA4xTSSATSbtKcfc"
ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1
Expected behavior
Project should build successfully as it does with HCaptcha 2.9.2
Environment
- Xcode Version: 16.2
- macOS Version: 15.2
- RevolutPayments/RevolutPay version: 3.6.0
- HCaptcha version causing issue: 2.9.3
- HCaptcha version working: 2.9.2
Additional context
- Issue only occurs when HCaptcha is pulled as transitive dependency
- Direct integration of HCaptcha 2.9.2 works fine
- Build settings include: EXCLUDED_ARCHS[config=Debug][sdk=iphonesimulator*] = arm64
@arpanCode thanks for reporting the issue, to be on the same page, you have to support x86_64 build? Or only arm64?
@CAMOBAP We're using Apple Silicon macs so only arm64 should be fine. However, it would be good to have both support like earlier versions.
@CAMOBAP We're using Apple Silicon macs so only arm64 should be fine. However, it would be good to have both support like earlier versions.
Hmm, could you please clarify a bit why do you set EXCLUDED_ARCHS[config=Debug][sdk=iphonesimulator*] = arm64 because basically you exclude build for iphonesimulator:arm64 which basically force Xcode to build for iphonesimulator:x86_64
Can you confirm that build without EXCLUDED_ARCHS[config=Debug][sdk=iphonesimulator*] = arm64 has the same problems?
Can you confirm that build without EXCLUDED_ARCHS[config=Debug][sdk=iphonesimulator*] = arm64 has the same problems?
Yes, project which does'n has arm64 exclusion also failing same build issue.
eg. Check sample app: https://bitbucket.org/revolut/revolut-payments-ios/src/master/Releases/3.6.0/
platform :ios, '13.0'
install! 'cocoapods',
:generate_multiple_pod_projects => true
use_frameworks!
workspace 'RevolutPayApp.xcworkspace'
project 'RevolutPayApp.xcodeproj'
def main_app_pods
pod 'RevolutPayments/RevolutPay'
end
target 'RevolutPayApp' do
main_app_pods
end
post_install do |installer|
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
end
end
end
end
@arpanCode thanks for more details. I have tried to build and run with Xcode 16.2, and no issues spotted sofar
My setups:
- Sonoma 14.6.1, Intel, 16.0
- Sequoia 15.3.1, M4 Pro, 16.2
My steps were:
git clone https://bitbucket.org/revolut/revolut-payments-ios.git
cd revolut-payments-ios/Releases/3.6.0/RevolutPay/ExampleApp
make project
make open
# run the project through
If my steps are correct, please provide a link to the full build log with build/derived data archives
@CAMOBAP Apologies for late reply!
I also check again and i am seeing same issue.
Can you please check which version was pulled when you cloned repo and did make project ?
I followed steps and it was pulling 2.9.2 version at first which works without issue.
when i did pod update and pulled 2.9.3. Started getting same issue.
@arpanCode thanks for more details. I have tried to build and run with Xcode 16.2, and no issues spotted sofar
My setups:
- Sonoma 14.6.1, Intel, 16.0
- Sequoia 15.3.1, M4 Pro, 16.2
My steps were:
git clone https://bitbucket.org/revolut/revolut-payments-ios.git cd revolut-payments-ios/Releases/3.6.0/RevolutPay/ExampleApp make project make open
run the project through
If my steps are correct, please provide a link to the full build log with build/derived data archives
@arpanCode thanks for the details, I can confirm that I reproduced it on my side, and will have a look
UPD ABI compatibility was broken because the new disablePat parameter was added. This does not reproduce for a pure Swift project because this param has a default value, and recompilation happens on the client side.
It seems that we have to allow create HCaptcha instance by passing HCaptchaConfig which can be built with builder pattern to avoid such problems in the future when we add a new param.