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

SPM : 'realm/util/assert.hpp' file not found When building project #6312

Closed
RomainPct opened this issue Oct 19, 2019 · 15 comments
Closed

SPM : 'realm/util/assert.hpp' file not found When building project #6312

RomainPct opened this issue Oct 19, 2019 · 15 comments

Comments

@RomainPct
Copy link

RomainPct commented Oct 19, 2019

It's now impossible to build RealmSwift embedded via Swift Package Manager. Xcode produce an error

Goals

Build my app which embed Realm as a Swift Package.

Expected Results

Successful build

Actual Results

Capture d’écran 2019-10-19 à 10 14 21

Capture d’écran 2019-10-19 à 10 14 53

Steps to Reproduce

Import Realm-cocoa via SwiftPackageManager in your project and try to build the project. Xcode produce a "lexical or preprocessor issue" because it does not found "assert.hpp".

Version of Realm and Tooling

ProductName: Mac OS X
ProductVersion: 10.15
BuildVersion: 19A582a

/Applications/Xcode.app/Contents/Developer
Xcode 11.1
Build version 11A1027

/usr/local/bin/pod
1.8.4
Realm (3.19.0)
RealmSwift (3.19.0)

/bin/bash
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin19)

/usr/local/bin/carthage
0.33.0
(not in use here)

/usr/bin/git
git version 2.21.0 (Apple Git-122)


Realm framework version: 3.19.1

Xcode version: 11.1

iOS/OSX version: Try to build for iOS 13.1

Dependency manager + version: Swift Package Manager

@mlenarto
Copy link

mlenarto commented Oct 23, 2019

I am seeing the same issue.
STR:

  1. New project.
  2. Add watch target.
  3. Add Realm as a package dependency.
  4. Add Realm and RealmSwift libs to iOS and watch extension targets.
  5. Build iOS scheme. Fails with error 'realm/util/assert.hpp' file not found

It builds fine for iOS, tvOS, or macOS apps, but if I add the libs to the watch target, the error occurs. If the error doesn't show, doing a clean build causes the error to show again.

@ivanvorobei
Copy link

For me also

@anonrig
Copy link

anonrig commented Nov 30, 2019

Having the same issue.

@ivanvorobei
Copy link

Any progress with it? I am use Watch target and can't use catalyst with installing realm with CocoaPods.
When try instal via SPM I get errors:

'realm/util/assert.hpp' file not found

@mlenarto write step by step for reproduce it.

@RomainPct
Copy link
Author

No progress for the moment but a really ugly solution to create an Watch App and a Catalyst App on the same project with Realm :

  • Install Realm with SPM for iOS app and Mac Catalyst
  • Install Realm with cocoapods for AppleWatch target

I hope it helps you,

Still waiting a fix for that annoying bug...

@ivanvorobei
Copy link

@RomainPct great idea!
I will try it now) Thanks.

@RealmBot
Copy link
Collaborator

➤ Lee Maguire commented:

Hi,

I cannot reproduce this issue with the latest version (Realm 4.3.2, RealmCore 5.23.8)

Thanks

@leemaguire
Copy link
Contributor

Here are my steps:

Include Realm via File->Swift Packages->Add Package Dependancy

Screenshot 2020-02-18 at 13 29 33

Make sure Realm and RealmSwift are added in your Watch apps Frameworks, Libraries & Embedded Content section of the watch target.

Screenshot 2020-02-18 at 13 39 39

@grEvenX
Copy link

grEvenX commented Mar 23, 2020

This is still an issue with Realm 4.3.2, RealmCore 5.23.8. We had to change to CocoaPods for Realm for now in order to not block our builds...

@DaveAlton
Copy link

I'm getting this error too. I'll have to switch to Carthage until this is fixed.

@running0x
Copy link

realm/realm-js#1449
realm/realm-js#2617
realm/realm-js#1427
realm/realm-js#1449
🤯
This issue, though transient has never been definitively explained or solved by Realm over the past few years. There are many suggested unsustainable workarounds - i.e to clear ios/build every time someone pulls a project, and/or pod deintegrate and pod install...neither of which is working for me today.

The Watch app is irrelevant for me - I am experiencing this without a Watch app on a fresh project. It seems to me there are obvious longstanding issues with the podspec/cocopods with Realm and almost every user in these threads has to find a work around.

@pavel-ship-it
Copy link
Contributor

Hi @darkheartfelt , which version of Realm you are using?
Our current release 10.1.4 is working fine with SPM.

@DominicFrei
Copy link
Contributor

I have also tried to reproduce this issue, here are my results:

@RomainPct Using all the information provided by you I created
https://github.com/DominicFrei/Playground/tree/realm/realm-cocoa/issues/6312-RomainPct
Is this precisely what you did on your side?

@mlenarto Using all the information provided by you I created
https://github.com/DominicFrei/Playground/tree/realm/realm-cocoa/issues/6312-mlenarto
Is this precisely what you did on your side?

Where default settings are mentioned they look like this:
Screenshot 2021-01-21 at 12 29 12
Screenshot 2021-01-21 at 12 35 00

In all cases I am able to successfully build all targets on all commits.

Additionally I created several other test projects to test this but could not reproduce it.

@RomainPct @mlenarto @varabeis @anonrig @grEvenX @DaveAlton Would anyone of you be able to provide their repository (or a sample version of it) that shows the above error?
We would really like to help you, but it seems to be a corner case that no one here was able to reproduce so far.

Looking forward to hearing from you!

@DominicFrei
Copy link
Contributor

@darkheartfelt The linked issues are RealmJS issues which seem to have been related to Cocoapods indeed.
This thread is about SPM and RealmSwift though. It is therefore unlikely to be a problem with the Podspec (in this case) since @RomainPct and @mlenarto do not even use Cocoapods to reproduce the issue.

I understand though you get the same error with Cocoapods?
Could you provide a sample repository that reproduces the issue so that we can dig further into it?

Thank you!

@leemaguire
Copy link
Contributor

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

@sync-by-unito sync-by-unito bot closed this as completed Feb 8, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 17, 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