realm / realm-swift

Realm is a mobile database: a replacement for Core Data & SQLite
https://realm.io
Apache License 2.0
16.27k stars 2.14k forks source link

'RealmSwiftObject' is not a member type of struct 'RealmSwift.Realm' #8587

Open tospery opened 4 months ago

tospery commented 4 months ago

How frequently does the bug occur?

Always

Description

When I make a ObjectMapper+Realm extension libraries, will get a compilation error

Stacktrace & log output

ObjectMapper_Realm.swiftinterface
'RealmSwiftObject' is not a member type of struct 'RealmSwift.Realm'
'RealmSwiftEmbeddedObject' is not a member type of struct 'RealmSwift.Realm'
It should be a problem with xcode, but I still don't know how to solve it. Can I solve it in my demo, thanks.
https://www.mongodb.com/community/forums/t/realm-xcframework-nested-in-another-xcframework-error/208190

Can you reproduce the bug?

Always

Reproduction Steps

run my demo

Version

10.50.0

What Atlas Services are you using?

Local Database only

Are you using encryption?

No

Platform OS and version(s)

simulator

Build environment

Xcode version: 15.3 added attachment ObjectMapper+Realm.zip

sync-by-unito[bot] commented 4 months ago

➤ PM Bot commented:

Jira ticket: RCOCOA-2359

tospery commented 4 months ago

i use this script, bu not working `#!/bin/bash

SEARCH_STRING1="Realm.RealmSwiftObject" REPLACE_STRING1="RealmSwift.Object"

SEARCH_STRING2="Realm.RealmSwiftEmbeddedObject" REPLACE_STRING2="RealmSwift.EmbeddedObject"

SWIFT_INTERFACE_FILES=$(find "$BUILT_PRODUCTS_DIR" -name '*.swiftinterface')

for file in $SWIFT_INTERFACE_FILES; do sed -i '' "s/$SEARCH_STRING1/$REPLACE_STRING1/g" "$file" sed -i '' "s/$SEARCH_STRING2/$REPLACE_STRING2/g" "$file" done`