Adyen / adyen-ios

Adyen iOS Drop-in and Components

Home Page:https://docs.adyen.com/checkout/ios

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't build on simulator for architecture arm64

brurend opened this issue · comments

Describe the bug
I receive this error when trying to build on simulator:
building for iOS Simulator, but linking in dylib built for iOS, file '.../Pods/Adyen3DS2/Dynamic/Adyen3DS2.framework/Adyen3DS2' for architecture arm64

Smartphone (please complete the following information):

  • Device: Any simulator
  • OS: iOS 14.2
  • SDK Version: Latest

Hi @brurend ,

Adyen3DS2 through cocaoPods, doesn't support arm64 simulator unfortunately.

if you're using the new Apple M1 MacBook, then you can use Swift Package Manager instead of cocoaPods.

but if you have a normal MacBook, then you need to exclude arm64 architecture from simulator builds.

Screen Shot 2020-11-27 at 3 39 22 PM

Shouldn't this be documented somewhere.

@kesavaj ,

Yes, you're right, we'll add a note in the read me file.

Hi @kesavaj @brurend,

Will close this ticket, please feel free to reopen it if you're still experiencing problems related to the same issue.

Mohamed

When do you intend to fix this problem in the Adyen SDK? Swift Package Manager lacks proper version locking at present, so is not a suitable replacement for Cocoapods, for any app that must be PCI compliant.

Hey @chriswrightlulu

are you having issues with build on M1?

Hi @descorp yes I am.

Using Cocoapods and M1, I get the same results as reported above. However we've already considered and discarded SPM for our project, because the version locking strategy doesn't fit our processes. I hope that changes in the future, but for now we are pretty stuck.

So I'm wondering what the timeline is (if there is one) for addressing the lack of arm64 support in the CocoaPods version.

Thanks!

Well I feel dumb. We are pinned on version 2.8 for some reason here. Looks like you have an entirely new major version, so I imagine we just aren't ready for a significant rewrite. Is this issue resolved in version 3?

Answered my own question: yes, it is fixed in version 3. Thanks for the quick response.

@chriswrightlulu

v2 -> v3 is a big change.
We are rolling out v4 soon (stable v4 is already in master, we are working on a new docs) !

Please let us know if you need help with migration ( in separate tickets 😄 )

V4.1.0 is released: It should fix the Cocoapods arm64 issue.

@descorp Working with version v4.1.0 working like a charm on the simulator but try to run it on an actual device I get the message:

Building for iOS, but linking in dylib file (/Users/h_rietman/Library/Developer/Xcode/DerivedData/App-gytomuzcfltjkdelkfltarbvfoyj/Build/Products/Debug-iphoneos/Adyen3DS2.framework/Adyen3DS2) built for Mac Catalyst, file '/Users/h_rietman/Library/Developer/Xcode/DerivedData/App-gytomuzcfltjkdelkfltarbvfoyj/Build/Products/Debug-iphoneos/Adyen3DS2.framework/Adyen3DS2' for architecture arm64

Any tips to make this work very much appreciated! Thanks

Thank you for your feedback!

Mac Catalyst could be a whole other story 🤔
We will investigate further!

Disregard my question :-) You got me triggered on Mac Catalyst and we should not even be building that; but somehow it is on by default after installing the pods. Unchecked 'Mac' from the General -> Deployment Info, clean build folder and rebuild did the trick.

Hi @brurend ,

Adyen3DS2 through cocaoPods, doesn't support arm64 simulator unfortunately.

if you're using the new Apple M1 MacBook, then you can use Swift Package Manager instead of cocoaPods.

but if you have a normal MacBook, then you need to exclude arm64 architecture from simulator builds.

Screen Shot 2020-11-27 at 3 39 22 PM

I just got a 2021 M1 MacBook Pro and now I can't build for Simulator anymore at least for Debug, Release works just fine.

Could not find module 'Adyen' for target 'x86_64-apple-ios-simulator'; found: arm64, arm64-apple-ios-simulator, at: /Users/martin.straub/Library/Developer/Xcode/DerivedData/myposter-geoegcibvexsfzdvlpapshzmylku/Build/Products/Debug-iphonesimulator/Adyen.swiftmodule

Guess it could be related to Build Active Architecture Only?
I'm using SPM, and afaik I cannot adjust any "Build Settings" there, right? So this must be done in the Package?

I mean M1 (using arm64) is out since more than a year now, so I guess there should be a solution. So probably I'm doing something wrong? 😬

Hey @d4rkd3v1l

SDK v4 works fine of M1 on Xcode 13+

What version are you using?
What error are you getting?

All the latest versions:
Adyen 4.5.0 via SPM
Xcode 13.2
M1 Max 10/32, 32GB, macOS Monterey 12.1

That's the error I get:

Could not find module 'Adyen' for target 'x86_64-apple-ios-simulator'; found: arm64, arm64-apple-ios-simulator, at: /Users/martin.straub/Library/Developer/Xcode/DerivedData/myposter-geoegcibvexsfzdvlpapshzmylku/Build/Products/Debug-iphonesimulator/Adyen.swiftmodule

Pretty sure it's misconfiguration on my side. I also have some dependencies resolved via CocoaPods.

I think I tried like everything nwo, but nothing worked, but using Release scheme.

  • Build Active Architecture Only yes/no
  • I changed Architecture to use x84_64 for simulators
  • I added/removed arm64 from Excluded Architectures
  • Tried different stuff vor VALID_ARCHS

The only thing that changed is that I ended up getting an error that said something like "can't link simulator to arm" somewhere in testing all the different settings.

My first thought was: M1 Mac = ARM, which actually should make things easier, as the simulator is ARM now too, not like before with the Intel CPUs.

Guess there are basically two ways to go.

a) Get everything working with ARM
b) Switch back to x86_64 using either Rosetta (which I feel is kinda stupid) or at least try to get the simulators back running using x86_64

Not quite sure currently which way is better... depends on other libs and their "simulator ARM" support as well, I guess.

Ok further investigation:

  • It works for Release builds, on simulator as well as devices
  • It works for Debug builds on devices
    -> Only thing that doesn't work is Debug builds on simulator (basically the configuration mostly used during development)

So definitely an issue with Simulator being ARM now, I guess.

@d4rkd3v1l

could you try create a blank project and add Adyen SPM to it?

Could not find module 'Adyen' for target 'x86_64-apple-ios-simulator'; found: arm64, arm64-apple-ios-simulator,

This is what you see if 'Build Active Archetecture Only' is NO on 'Debug'

Having the same problem as above, got my new M1 Mac yesterday and the Adyen package was added to our project yesterday which is kind of humour... running Xcode with rosetta now ☹️

Hey @BosseGr

I am not able to reproduce this on my local Mac M1 🤔
If you create a blank project and add Adyen - does it have the same error?

Works on a blank project so I will do some digging in our project... thanks for a quick reply!

Sorry, guys didn't have any time to look further into this. So I ended up running Xcode via Rosetta as a workaround until I got the time to get into this.

We are working on M1 compatibility for our SDK.
Seems like the issue caused by a WeChat static library that does not support arm64 for simulator.

On a new "experimental" setup I have noticed x86_64-apple-ios-simulator compile error with Cocoapods when using pod 'Adyen/WeChatPay'.
Indeed, as @d4rkd3v1l mentioned - switching to Rosetta hides the issue.
SPM work as expected with and without Rosetta.

Will keep you posted..

This issue is still going on.
When is it going to be added the support to build on arm devices without excluding the arch??

Hey @Noitham

What is your setup:

  • SDK version
  • Cocoapods / SPM / Carthage
  • Xcode version
  • Mac version
  • MacOS version
  • using WeChat ?