adyen-ios: [BUG] ayden-ios fails to build via carthage on Xcode 12 betas 2, 3 , 4

Describe the bug When trying to add ayden-ios as a dependency to a project using Xcode 12 beta 3 via Carthage, the compilation fails with the following error:

⇒  carthage bootstrap --platform ios --use-ssh
*** No Cartfile.resolved found, updating dependencies
*** Fetching adyen-ios
*** Fetching adyen-3ds2-ios
*** Checking out adyen-3ds2-ios at "2.1.0-rc.5"
*** Checking out adyen-ios at "3.6.0"
*** xcodebuild output can be found in /var/folders/83/g4z5yhjj5cl5ww7gyf3h869m0000gp/T/carthage-xcodebuild.VDLNeQ.log
*** Downloading adyen-3ds2-ios.framework binary at "2.1.0-rc.5"
*** Building scheme "Adyen" in Adyen.xcodeproj
Build Failed
	Task failed with exit code 65:
	/usr/bin/xcrun xcodebuild -project /Users/einternicola/Code/watches/CarthageAydenExample/Carthage/Checkouts/adyen-ios/Adyen.xcodeproj -scheme Adyen -configuration Release -derivedDataPath /Users/einternicola/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A8169g/adyen-ios/3.6.0 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/83/g4z5yhjj5cl5ww7gyf3h869m0000gp/T/adyen-ios SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/einternicola/Code/watches/CarthageAydenExample/Carthage/Checkouts/adyen-ios)

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/83/g4z5yhjj5cl5ww7gyf3h869m0000gp/T/carthage-xcodebuild.VDLNeQ.log

To Reproduce Steps to reproduce the behavior:

  1. Download and install Xcode12 beta 3
  2. Use xcode select to set this as your xcode: xcode-select --switch /Applications/Xcode-beta.app
  3. Create a new Xcode project
  4. Create a Cartfile with the following contents: github "Adyen/adyen-ios" == 3.6.0
  5. Execute the following command: carthage bootstrap --platform ios --use-ssh
  6. Observe the failure (similar to what I noted above)

Expected behavior I expect Carthage to build ayden-ios successfully.

Screenshots image

Smartphone (please complete the following information):

  • Device: MacBook Pro (16-inch, 2019)
  • OS: macOS Catalina 10.15.5 (19F101)
  • Xcode: 12.0 beta 3 (12A8169g)
  • SDK Version 3.6.0

Additional context N/A

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 9
  • Comments: 28 (7 by maintainers)

Most upvoted comments

I have just tried building again using the Xcode 12 GM (Version 12.0 (12A7208)) and it still failing. It provides even less information in the log though:

Cartfile contents:

github "adyen/adyen-ios" >= 3.6.0

Command:

carthage update --platform ios

Result:

*** Fetching adyen-ios
*** Fetching adyen-3ds2-ios
*** Checking out adyen-ios at "3.6.0"
*** Checking out adyen-3ds2-ios at "2.2.0"
*** xcodebuild output can be found in /var/folders/jw/7p44sfp97wn0r9lxqp02d94h0000gn/T/carthage-xcodebuild.HiwYek.log
*** Downloading adyen-3ds2-ios.framework binary at "2.2.0"
*** Building scheme "AdyenCard" in Adyen.xcodeproj
Build Failed
	Task failed with exit code 65:
	/usr/bin/xcrun xcodebuild -project /Users/einternicola/Code/watches/CarthageXcode12Test/Carthage/Checkouts/adyen-ios/Adyen.xcodeproj -scheme AdyenCard -configuration Release -derivedDataPath /Users/einternicola/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7208/adyen-ios/3.6.0 -sdk iphonesimulator -destination platform=iOS\ Simulator,id=E1C7E02B-05ED-433C-94D3-C02045DF8640 -destination-timeout 3 ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES build (launched in /Users/einternicola/Code/watches/CarthageXcode12Test/Carthage/Checkouts/adyen-ios)

Log (excerpt):

Ld /Users/einternicola/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7208/adyen-ios/3.6.0/Build/Intermediates.noindex/Adyen.build/Release-iphonesimulator/AdyenCard.build/Objects-normal/arm64/Binary/AdyenCard normal arm64 (in target 'AdyenCard' from project 'Adyen')
    cd /Users/einternicola/Code/watches/CarthageXcode12Test/Carthage/Checkouts/adyen-ios
    /Applications/Xcode-12-GM.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target arm64-apple-ios10.0-simulator -dynamiclib -isysroot /Applications/Xcode-12-GM.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk -L/Users/einternicola/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7208/adyen-ios/3.6.0/Build/Products/Release-iphonesimulator -F/Users/einternicola/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7208/adyen-ios/3.6.0/Build/Products/Release-iphonesimulator -FCarthage/Build/iOS -filelist /Users/einternicola/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7208/adyen-ios/3.6.0/Build/Intermediates.noindex/Adyen.build/Release-iphonesimulator/AdyenCard.build/Objects-normal/arm64/AdyenCard.LinkFileList -install_name @rpath/AdyenCard.framework/AdyenCard -Xlinker -rpath -Xlinker /usr/lib/swift -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/einternicola/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7208/adyen-ios/3.6.0/Build/Intermediates.noindex/Adyen.build/Release-iphonesimulator/AdyenCard.build/Objects-normal/arm64/AdyenCard_lto.o -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -L/Applications/Xcode-12-GM.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -L/usr/lib/swift -Xlinker -add_ast_path -Xlinker /Users/einternicola/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7208/adyen-ios/3.6.0/Build/Intermediates.noindex/Adyen.build/Release-iphonesimulator/AdyenCard.build/Objects-normal/arm64/AdyenCard.swiftmodule -framework Adyen3DS2 -framework Adyen -compatibility_version 1 -current_version 3.6.0 -Xlinker -dependency_info -Xlinker /Users/einternicola/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7208/adyen-ios/3.6.0/Build/Intermediates.noindex/Adyen.build/Release-iphonesimulator/AdyenCard.build/Objects-normal/arm64/AdyenCard_dependency_info.dat -o /Users/einternicola/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7208/adyen-ios/3.6.0/Build/Intermediates.noindex/Adyen.build/Release-iphonesimulator/AdyenCard.build/Objects-normal/arm64/Binary/AdyenCard
ld: building for iOS Simulator, but linking in dylib built for iOS, file 'Carthage/Build/iOS/Adyen3DS2.framework/Adyen3DS2' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **


The following build commands failed:
        Ld /Users/einternicola/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7208/adyen-ios/3.6.0/Build/Intermediates.noindex/Adyen.build/Release-iphonesimulator/AdyenCard.build/Objects-normal/arm64/Binary/AdyenCard normal arm64
(1 failure)

@descorp here is a Cocoapods thread on the podspec workaround to exclude arm64: https://github.com/CocoaPods/CocoaPods/issues/10065

Adyen will need to add this to both Adyen3DS2 and Adyen podspecs, since Adyen depends on Adyen3DS2. But as noted in that thread and the Intercom example posted above, this is a temporary workaround. As soon as people start using Apple Silicon Macs for development, this is going to cause big problems. Migrating to XCFramework or fixing the binary is the real solution.

The issue I am facing is that I develop a private Cocoapod for my employer, and our pod depends on Adyen. We are unable to publish our pod to our private Cocoapods spec repo because pod spec lint fails due to this architecture issue. The workaround we have found is to privately host a copy of the Adyen and Adyen3DS2 podspecs with the workaround added:

  # workaround for binary dependencies, see https://github.com/CocoaPods/CocoaPods/issues/10065
  s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
  s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }

and we have to add this workaround to our private podspec as well.

@juanuribeo13, I’ve discovered recently that if you set ONLY_ACTIVE_ARCH parameter to YES in your target and pods then it compiles and archives without this error.

You can add this to your Podfile and see if it helps:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings["ONLY_ACTIVE_ARCH"] = "YES"
    end
  end
end

@descorp Hi, am having issue in running Unit tests while having “Ayden” pod, issue am facing is this? Screenshot 2021-03-03 at 6 19 14 PM Build is successful but when unit tests starts running, it got failed.

Hey @descorp

I think that the issue with Cocoapods could be fixed by excluding arm64 for simulator builds in .podspec file.

It was done with Intercom as you can see here: https://github.com/intercom/intercom-ios/pull/385

Not all heroes wears capes! 🦸‍♂️ Thanks a lot @intere

From what I can see - this is a temporary (I hope so) issue, that should be fixed with stable\next Xcode build. Issue caused by using armv7 functionality on new arm64 architectures (looks like the String is a man suspect)

It could be fixed in two ways:

  1. by striping up armv7 architecture or rebuilding .framework with target version iOS13. source1 source2 source3
  2. by dirty magic with Strings source1 source2

Unfortunately, we can’t promise to fix it on our end quick enough( not before it is done by Cartages, at least 😄 ) I’ll keep my eye on Cartage.

This might also be of some help: https://developer.apple.com/forums/thread/649918

In doing some more research, this might not be an Adyen specific issue: https://github.com/Carthage/Carthage/issues/3019

Hi @intere

Thanks for the feedback! Could you also print out xcodebuild log?