Could not find module for target x86_64-apple-ios-simulator

I have build a custom framework and everything was working fine until the update of XCode 11. The new XCode 11 released and we now I am unable to run my Custom Framework into a project in Simulator. I always get this error

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

Can someone please let me know how to fix this error. I have already tried adding the framework and tried running the same in a different project however I am not able to fix this. Any help would be appreciated. Thanks

Replies

This fixed my problem:
On build settings select YES on "Always embed swift standard libraries"

set "Build Active Architure Only" to Yes solve my problem

Bumping the iOS version in Deployment Info to from 9.0 to 12.0 fixed it for me

I have the same problem while building on M1. Just because I used this : pod "GoogleMobileAdsMediationFacebook" pod 'GoogleMobileAdsMediationAppLovin', anyone can explain why ?

Today I solved this error on our app for library 'CodableWrappers' and this solved my problem:

  • close XCode
  • open Finder app and show there "Applications"
  • right click on icon Xcode and click on "Get info" (or something similar)
  • there is checkbox "Open with Rosseta" (or something similar). Select it
  • run Xcode again and try to build

I hope it help you.

Hello @ludvik.polak

I am not able to the checkbox for "Open with Rosseta" Could you just help me out with an alternate process for the same my xcode version - 12.5.1

now in Xcode 13.3 after opening with Rosetta project can not be build, it was canceled every time, hate Xcode very simple bad bugs everytime

Apple does not give a duck about developers. Their tools are ugly and bugs are never fixed. The business is focused on making revenue selling the phones, and no one wants to spend resources making developer tools decent

I was running Version 14.0.1 (14A400), I tried the building with targets above, I ended up changing the "Build Active Architectures Only" setting to No for each of the pod targets (and main target) which seemed to fix it, again it was only an issue on the sim. I believe it has something to do with the Apple Silicone changes.

Swift 5.0-5.1, Xcode 11
Open Xcode, <your project>, Build Settings, Build Active Architecture Only and change to <NO> for Debug and Release. Architectures set/leave in Standard Architecture -$(ARCHS_STANDARD), important is next step:
Valid Architecture: armv7, armv7s, arm64, arm64e, ADD here x86_64 and if you need add i386 for Debug and Release. (String: armv7, armv7s, arm64, arm64e, x86_64)

Choose any simulator in your simulator list and BUILT IT. DONE. 

I hope it is works for you.

Description of Architecture:

armv64: iPhoneX, iPhone 5s-8, iPad Air — iPad Pro

armv7 : iPhone3Gs-5c, iPad WIFI(4th gen)

armv6 : iPhone — iPhone3G

-the above if for real devices

i386 : 32-bit simulator

x86_64 : 64-bit simulator

How do you building? using Carthage or something?

How do you building? using Carthage or something?

No, I'm using Cocoapod

I am also having the same issue with new M1 Mac. AFAIK, iPhone simulators are available in either arm64 or x86_64 architectures.

In some cases, subset of users have to opt out of arm64 architecture due to library linking issue with M1 Mac (and also for old Intel Macs).

In those cases, when arm64 is excluded, Xcode will attempt to run project in x86_64, but because lottie-ios does not seem to support x86_64 simulators, and it will fail with error like below.

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

I am also curious to know if there is any particular reason why this library can't run in simulator with x86_64 architecture. Can this restriction simply be relaxed with a simple config change?

Exey, TwoDollarsEsq, molchanovskiy, E-B-Smith, viktor-idenfy, RolandasRazma, ClaesCJ, ShawnBaek, tomekfab, Tiza59, and 5 more reacted with thumbs up emoji

I had luck with this changing the configuration away from Debug. I suspect it has something to do with this:

Could not find module for target x86_64-apple-ios-simulator

However, lottie-ios is no different than any number of other pods in this one setting.

Hi, I'm having the same issue
Could not find module 'Lottie' for target 'x86_64-apple-ios-simulator'; found: arm64, arm64-apple-ios-simulator.

Can't build on simulator or use swiftui previews :(
I tried all the combinations I could find on VALID_ARCHS, Build Active Architecture Only, Excluded Architectures and such.

I use Swift Package Manager btw

:(

@gevartosky I don't think this issue is fixable user-side if you use SPM. @buba447 likely needs to re-release with "build active architecture only" set to "No" for both Debug & Release. If you are using a legacy cocoapods installation you can override this setting, otherwise I've found no way so far to fix it.

To provide some clarity on reproducing this issue, I happens for me 100% of the time when you:

  1. Use apple Silicion/M1

  2. Xcode 12.5

  3. Add lottie via SPM

  4. import Lottie anywhere in your project

  5. Attempt to use SwiftUI previews.

Make a trivial VStack { Text("hello workd") } etc and the preview will fail to render with the error:

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

Not sure why xcode is trying to spin up an x86-64-apple-ios-simulator on an M1...

Hello all! I'm happy to report after some experimentation I appear to have solved it.

Some caveats:

  1. I'm on apple silicon

  2. I'm only deploying to iOS and have it set to iOS13 and above (But I suspect iOS minimums of 11 and higher are ok to do this as well)

The fix:

-Go to project/build settings (so it applies to all targets)

-Search "arch" and get "Architectures". The default for debug/release is "standard architectures" which includes arm64 AND armv7

-Change the top/all values to "arm64". Clean build.

-SwiftUI previews should work! I also have "build active architecture only" set to YES for debug, but that shouldn't matter anymore since we only support one arch.

What I think is happening:

-armv7 is old 32-bit iOS devices, the last of which that was sold is the 5C (!!!) For some reason, xcode 12.5 with a 13.0+ deployment target still includes 32-bit armv7 as a supported architecture! I have no idea why this is the case. Removing it seemed to fix the problem.

I am getting the same error on non-m1 chip

Hello all! I'm happy to report after some experimentation I appear to have solved it.

Some caveats:

  1. I'm on apple silicon
  2. I'm only deploying to iOS and have it set to iOS13 and above (But I suspect iOS minimums of 11 and higher are ok to do this as well)

The fix:

-Go to project/build settings (so it applies to all targets)

-Search "arch" and get "Architectures". The default for debug/release is "standard architectures" which includes arm64 AND armv7

-Change the top/all values to "arm64". Clean build.

-SwiftUI previews should work! I also have "build active architecture only" set to YES for debug, but that shouldn't matter anymore since we only support one arch.

What I think is happening:

-armv7 is old 32-bit iOS devices, the last of which that was sold is the 5C (!!!) For some reason, xcode 12.5 with a 13.0+ deployment target still includes 32-bit armv7 as a supported architecture! I have no idea why this is the case. Removing it seemed to fix the problem.

Like this?

Could not find module for target x86_64-apple-ios-simulator

This was referenced

Jul 19, 2021

Open Xcode, , Build Settings, Build Active Architecture Only and change to for Debug and Release. Architectures set/leave in Standard Architecture -$(ARCHS_STANDARD), important is next step:
Valid Architecture: armv7, armv7s, arm64, arm64e, ADD here x86_64 and if you need add i386 for Debug and Release. (String: armv7, armv7s, arm64, arm64e, x86_64)

Choose any simulator in your simulator list and BUILT IT. DONE.

Today I ran into this problem on my M1 architecture machine and the solution for me was to have Xcode open using Rosetta.

Edit: I'm using Lottie in a React Native context

Could not find module for target x86_64-apple-ios-simulator

What work for me(React Native Project):

  1. Create new react native project
  • you may be able to skip step 2, i was have to do it because we try to change the swift setting for the lottie..
  1. take the new project.pbxproj, move it to your project, and reenter you old settings again
  2. go to ios folder and run the following command arch -x86_64 sudo gem install ffi
  3. pod deintegrate
  4. pod install

But if you don't use pod but use SPM, you get the same error.

Today I ran into this problem on my M1 architecture machine and the solution for me was to have Xcode open using Rosetta.

Edit: I'm using Lottie in a React Native context

Could not find module for target x86_64-apple-ios-simulator

This solved my issue, Thanks.

For me, adding following lines to the podfile fixed the issue:

post_install do |pi|
    pi.pods_project.targets.each do |t|
      t.build_configurations.each do |config|        
        config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
        config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
      end
    end
end

Current Working Solution 🎉

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