Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miss one or more architectures required by this target: arm64, x86_64. #6957

Closed
rantianhua opened this issue Nov 21, 2020 · 14 comments
Closed

Comments

@rantianhua
Copy link

rantianhua commented Nov 21, 2020

Goals

Use realm-cocoa in watchOS target through Carthage.

Expected Results

I can use realm framework build through Carthage in watchOS target.

Actual Results

error: The linked framework 'RealmSwift.framework' is missing one or more architectures required by this target: arm64, x86_64

Steps for others to Reproduce

Use Carthage 0.36.0 to build realm 5.3.0 with the watchOS platform. Then link this framework in Xcode 12.2 to build.

Code Sample

Version of Realm and Tooling

Realm framework version: ?
5.3.0
Realm Object Server version: ?
??
Xcode version: ?
12.2
iOS/OSX version: ?
Build settings from command line:

CARTHAGE = YES
CLANG_ENABLE_CODE_COVERAGE = NO
CODE_SIGN_IDENTITY = 
CODE_SIGNING_REQUIRED = NO
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO
ONLY_ACTIVE_ARCH = NO
SDKROOT = watchos7.1
SKIP_INSTALL = YES
STRIP_INSTALLED_PRODUCT = NO

Dependency manager + version: ?
Carthage 0.36.0

@jsflax
Copy link
Contributor

jsflax commented Nov 21, 2020

You'll have to upgrade to realm v10.1.4 for arm64 support.

@rantianhua
Copy link
Author

@jsflax Another two questions:

  1. Is v10.1.4 compatible with v5.3.0?
  2. How about x86_64? Still not support in Xcode 12.2?

@ZComwiz
Copy link

ZComwiz commented Nov 22, 2020

@jsflax — When building the app on v10.1.4 for archiving to the app store the error occurs:

Umbrella header 'Realm.h' not found in module.map
and could not build Objective-C module 'Realm'

(latest version of cocoapods 1.10.0)

Already attempted to clear derivedData/build folder.

@leemaguire
Copy link
Contributor

@ZComwiz I cannot reproduce on Xcode 12.2, Cocoapods 1.10 and Realm Swift 10.1.4, Are you able to reproduce the issue with a new test project?

@ZComwiz
Copy link

ZComwiz commented Nov 23, 2020

@leemaguire The fix for me was to move all Realm files from private to public when archiving the project.

@leemaguire
Copy link
Contributor

@ZComwiz It's strange you had to do that. Another thing I could suggest is deleting the pods folder and doing a fresh pod install

@ZComwiz
Copy link

ZComwiz commented Nov 23, 2020

@leemaguire I suppose I should have mentioned that I did that already as well, but working on iOS and React Native apps for so long I just figured it was implied that one should try that first haha. RealmSwift was having issues seeing the Realm.h and other files in Realm framework when installed with Cocoapods ONLY during the archiving for app store process on MacCatalyst.

@leemaguire
Copy link
Contributor

leemaguire commented Nov 23, 2020

@ZComwiz I can reproduce when archiving for Catalyst, good catch! Thomas is looking into this CocoaPods/CocoaPods#10224

@JonnyBeeGod
Copy link

@leemaguire The fix for me was to move all Realm files from private to public when archiving the project.

Can you elaborate on how to do this? Running into similar issues here

@ZComwiz
Copy link

ZComwiz commented Nov 24, 2020

@leemaguire The fix for me was to move all Realm files from private to public when archiving the project.

Can you elaborate on how to do this? Running into similar issues here

Hi @JonnyBeeGod. So its a bit of a hack work around that only works for archiving the app, but will break your ability to run it in debug mode because of redundant module files being compiled so you will need to revert your changes by either reversing this or deleting pods and re pod installing.

  1. Navigate to Pods project file in XCode.
  2. Find Realm in the targets list on the left hand side.
  3. Navigate to Build Phases tab.
  4. Move all the private header h files from private to public.
  5. Do the same for RealmSwift framework if necessary.

@JonnyBeeGod
Copy link

Hi @JonnyBeeGod. So its a bit of a hack work around that only works for archiving the app, but will break your ability to run it in debug mode because of redundant module files being compiled so you will need to revert your changes by either reversing this or deleting pods and re pod installing.

  1. Navigate to Pods project file in XCode.
  2. Find Realm in the targets list on the left hand side.
  3. Navigate to Build Phases tab.
  4. Move all the private header h files from private to public.
  5. Do the same for RealmSwift framework if necessary.

Thank you. Unfortunately that did not solve my issues but it was worth a try ;)

@jsflax
Copy link
Contributor

jsflax commented Dec 16, 2020

@rantianhua can you confirm that this is still an issue?

@JonnyBeeGod you as well? We find that most Cocoapods issues are due to a bad cache.

@JonnyBeeGod
Copy link

It did not in my case I was cleaning pods folder and cocoa pods cache before my builds. Found the solution to my problem however in another issue somewhere. I had a private pod A with realmswift and realm as dependencies. When I used this pod as dependency in another pod B I was having those linker issues. The solution was to add realm as dependency to pod B podspec as well.

@sync-by-unito sync-by-unito bot closed this as completed Mar 24, 2021
@sync-by-unito
Copy link

sync-by-unito bot commented Mar 24, 2021

➤ Brian Munkholm commented:

Closing for now then.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants