M1 - Failed to load the test bundle, doesn’t contain a version for the current architecture

My project is modular project. I am unable to run unit test locally. All the time when I tried to run on the M1 chip laptop I got below error.

Error: The bundle “XXXXTests” couldn’t be loaded because it doesn’t contain a version for the current architecture. The bundle doesn’t contain a version for the current architecture. Try installing a universal version of the bundle. dlopen_preflight

I tried below link solution. https://github.com/CocoaPods/CocoaPods/issues/10733

Anyone can help me out? Any solution for this?

If you are running your test for the simulator, did you check that all your dependencies and your framework are compiled for arm64? Remember that for intel Mac the architecture was x86_64, but in the case of the M1, you should choose arm64.

M1 - Failed to load the test bundle, doesn’t contain a version for the current architecture
 
 
Q