Realm-cocoa: "visibility settings" error in core when building via CocoaPods

Created on 20 Jan 2017  路  15Comments  路  Source: realm/realm-cocoa

Hi Guys,

After updating to Realm 2.3.0 (was 2.1.2), I get the following warning in Xcode:

direct access in function 'realm::SharedGroup::SharedGroup(realm::Replication&, realm::SharedGroupOptions)' from file '/Users/xxxx/Documents/Projects/ImageScape/Pods/Realm/core/librealm-ios.a(client_file_access_cache-iphonesimulator.o)' to global weak symbol 'realm::util::InterprocessMutex::initialize_statics()' from file '/Users/xxxx/Library/Developer/Xcode/DerivedData/ImageScape-hetxuiirverpbbdrqeqlutdnufdo/Build/Products/Debug-iphonesimulator/Realm/libRealm.a(shared_realm.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.

As far as I can check everything works as expected, but the warning isn't nice of course. Thanks!

Script info:

ProductName:    Mac OS X
ProductVersion: 10.12.2
BuildVersion:   16C67

/Applications/Xcode.app/Contents/Developer
Xcode 8.2.1
Build version 8C1002

/usr/local/bin/pod
1.0.0
Realm (2.3.0)

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

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

/usr/bin/git
git version 2.10.1 (Apple Git-78)
P-2-Expected T-Bug

Most helpful comment

Hi! Same problem on 2.4.2

All 15 comments

Thanks for reporting this, @yuggieg! Would you be able to provide a sample project that reproduces the issue so we can better debug this? Cheers! :-)

No need to send us a repro case @yuggieg, we can see this too. This is a similar linker warning as realm/realm-object-store/issues/281 and https://github.com/realm/realm-cocoa/issues/4438. I thought we had updated our upstream projects to use the same visibility settings, but evidently that's not the case. I'm looking into this.

Hi! Same problem on 2.4.2

@jpsim ^

install realm by pod could cause it on 2.4.2 and wouldn't appear install by static framework

I have the same warning since several versions before.

The same warning in the version 2.7.0.

Yes, this is still a problem. I haven't found a reliable way to avoid it in all cases, however.

Mark. The problem still exists in 2.8.0. (Xcode 8.2.1 CocoaPods 1.2.1)

Correct, this problem still exists, under certain compiler conditions with CocoaPods. If anyone has suggestions for a proper fix that works under all circumstances, please let me know

The problem still exists in 2.10.0. Thanks!

The problem still exists in 2.10.0.

Still happening in 2.10.1

Still happening in 2.10.2

Still happening in 3.0.2 when linking statically, though not when linking as a framework.

Was this page helpful?
0 / 5 - 0 ratings