facebook / facebook/facebook-ios-sdk

Build failed because FacebookCore.swiftmodule is missing a required architecture

Open
#2,229 4 comments 4 reactions 0 assignees View on GitHub
bug needs-triage
Dominant language
Swift
Stars
8.1k
Forks
3.7k
PR merge metrics
No merged PRs in 30d

Description

### Checklist before submitting a bug report

- [X] I've updated to the latest released version of the SDK
- [X] I've searched for existing [GitHub issues](https://github.com/facebook/facebook-ios-sdk/issues)
- [X] I've looked for existing answers on [Stack Overflow](https://facebook.stackoverflow.com), the [Facebook Developer Community Forum](https://developers.facebook.com/community/) and the [Facebook Developers Group](https://www.facebook.com/groups/fbdevelopers)
- [X] I've read the [Code of Conduct](https://github.com/facebook/facebook-ios-sdk/blob/main/CODE_OF_CONDUCT.md)
- [X] This issue is not security related and can safely be disclosed publicly on GitHub

### Xcode version

14.3.1

### Facebook iOS SDK version

16.1.2

### Dependency Manager

SPM

### SDK Framework

Core

### Goals

I want to use the Facebook SDK.

### Expected results

To be able to `import FacebookCore`.

### Actual results

(This is on the same project as #2228 but a different problem, I think. Maybe related.)

I add FacebookCore, FacebookLogin and FacebookShare package through Swift Package Manager. As soon as I add `import FacebookCore` to a source, I get

> Could not find module 'FacebookCore' for target 'x86_64-apple-ios-simulator'; found: arm64-apple-ios-simulator, at: [...]

If I ignore this and try to build, I am presented with the error:

> Build failed because FacebookCore.swiftmodule is missing a required architecture. Would you like to build for Rosetta instead?

If I build for Rosetta it works, but do I have to? Looks like I can't change Swift package build settings, and I'm not sure what about my project build settings needs to change.

I have

```
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
ONLY_ACTIVE_ARCH = no;
```

for {Debug, Release, Automation}. Not sure what else is pertinent?

### Steps to reproduce

1) Add FacebookCore, FacebookLogin and FacebookShare
2) Add `import FacebookCore` to a source file
3) Try to build

### Code samples & details

```swift
// INSERT YOUR CODE HERE
var example = "Example code"
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.