realm-swift: Using RealmSwift.NotificationToken type when RealmSwift acts as a dependency fails CocoaPods lib lint validation
Goals
Use RealmSwift as a dependency for CocoaPod in Xcode 12. Not sure when this started happening, as this integration was working for couple of years without any issues.
Expected Results
When using RealmSwift as a dependency, pod lib validation should succeed.
Actual Results
Pod lib lint returns undefined symbols error:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_RLMNotificationToken"
Steps for others to Reproduce
- Clone https://github.com/DenTelezhkin/DTModelStorage, branch cocoapods-enable-realm
- Run
bundle exec pod lib lint --allow-warnings --no-clean --verbose - Observe build failures.
Code Sample
Attaching CocoaPods-generated project that failed pod lib lint validation for easier debugging:
CocoaPods-Lint-20200923-61087-vg31ow-DTModelStorage.zip
Also build failure can be observed on CI:
https://github.com/DenTelezhkin/DTModelStorage/runs/1154609764?check_suite_focus=true
It seems, that the only issue is with RLMNotificationToken type, because if the code referencing this type is commented out, build succeeds.
Version of Realm and Tooling
Xcode 12 CocoaPods 1.10.0.beta.2 Realm 5.3.5 RealmCore 6.0.19
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 10
- Comments: 15 (1 by maintainers)
Commits related to this issue
- add DAO manually due https://github.com/realm/realm-cocoa/issues/6800 — committed to petropavel13/TestPodspecs by petropavel13 4 years ago
- add RedAlert-UI 2.4.0 manually due https://github.com/realm/realm-cocoa/issues/6800 — committed to petropavel13/TestPodspecs by petropavel13 4 years ago
- add RedAlert-UI 2.4.0 manually due https://github.com/realm/realm-cocoa/issues/6800 — committed to petropavel13/TestPodspecs by petropavel13 4 years ago
- Realm is depended upon https://github.com/realm/realm-cocoa/issues/6800#issuecomment-733657228 — committed to UWDevApp/Cognostic by ApolloZhu 3 years ago
- Fix Realm dependency: https://github.com/realm/realm-cocoa/issues/6800 — committed to rcaos/TVToday by rcaos 3 years ago
Looks like we need to add
Realmtopodspecfile:Otherwise your target will not depend on
RealmdespiteRealmSwifthas dependency onRealm:Looks like coocapods bug.
For example:
Target dependencies in Pods project with implicit
Realmdependency:Target dependencies in Pods project with explicit
Realmdependency:Hi,
We are facing the same issue as well. Xcode 12 Cocoapods 1.9.3 Realm 5.5.0
Is there any kind of update?
Thanks, Nilit
Having the same issue here.
Xcode 12 Cocoapods 1.9.3 Realm 5.4.3
I am also getting the same error for RealmSwiftObject