question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error installing and running Realm iOS

See original GitHub issue

Goals

Install Realm and be able to run the app

Expected Results

Realm installs and able to be used in the app.

Actual Results

Build fails and app comes with missing Realm constructor error.

Warning when realm installs

node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download.

Seems to install fine. React-native link realm produces no errors.

Have tried installing Realm in a brand new build and same issue. Funnily enough it runs fine on Android.

The build fails when running react-native run-ios.

In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/chrono:303:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ctime:59:9: error: no member named 'tm' in the global namespace
using ::tm;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ctime:60:9: error: no member named 'clock' in the global namespace
using ::clock;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ctime:61:9: error: no member named 'difftime' in the global namespace
using ::difftime;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ctime:62:9: error: no member named 'mktime' in the global namespace; did you mean 'mktemp'?
using ::mktime;
      ~~^
In file included from /Users/Developer/Documents/Projects/TeRakauTaumatuaApp/node_modules/realm/react-native/ios/RealmReact/RealmReact.mm:19:
In file included from /Users/Developer/Documents/Projects/TeRakauTaumatuaApp/node_modules/realm/react-native/ios/RealmReact/RealmReact.h:19:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:18:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/assert.h:44:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/stdlib.h:94:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/stdlib.h:216:7: note: 'mktemp' declared here
char    *mktemp(char *);
         ^
In file included from /Users/Developer/Documents/Projects/TeRakauTaumatuaApp/node_modules/realm/react-native/ios/RealmReact/RealmReact.mm:19:
In file included from /Users/Developer/Documents/Projects/TeRakauTaumatuaApp/node_modules/realm/react-native/ios/RealmReact/RealmReact.h:19:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:31:
In file included from ../../../../ios/Pods/Headers/Public/gRPC-C++/grpcpp/support/time.h:22:
In file included from ../../..
/../ios/Pods/Headers/Public/gRPC-C++/grpcpp/impl/codegen/time.h:22:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/chrono:303:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ctime:63:9: error: no member named 'time' in the global namespace
using ::time;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ctime:65:9: error: no member named 'asctime' in the global namespace
using ::asctime;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ctime:66:9: error: no member named 'ctime' in the global namespace
using ::ctime;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ctime:67:9: error: no member named 'gmtime' in the global namespace
using ::gmtime;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ctime:68:9: error: no member named 'localtime' in the global namespace
using ::localtime;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ctime:70:9: error: no member named 'strftime' in the global namespace
using ::strftime;
      ~~^


** BUILD FAILED **

Version of Realm and Tooling

Realm JS SDK Version: v2.18.0 Node or React Native: Node v8.11.3 RN @0.57.1 Client OS & Version: OS Mojave 10.14

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11

github_iconTop GitHub Comments

3reactions
Malikkhoja-zzcommented, Oct 4, 2019

Facing same issue on RN 0.61.2 and Realm 3.2.0. Any suggestions?

3reactions
reyn-novacommented, Oct 25, 2018

@taylor-pringle I have facing this issue while using XCode 10, are you using XCode 10? If you using Xcode 10 then you need downgrade to previous XCode version because react-native doesn’t fully supporting XCode 10 yet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error installing Realm in Terminal through cocoapods
In your Podfile, add use_frameworks! and pod 'RealmSwift' to your main and test targets. From the command line, run pod install .
Read more >
Realm: Create reactive mobile apps in a fraction of the time
Install CocoaPods 1.10.0 or later. Run pod repo update to make CocoaPods aware of the latest available Realm versions. In your Podfile, add...
Read more >
RealmSwift on CocoaPods.org
Realm is a mobile database that runs directly inside phones, tablets or wearables. This repository holds the source code for the iOS, macOS,...
Read more >
Realm Object Server Documentation
For information on installing and running Realm Object Server on Ubuntu, Red Hat Enterprise ... fatal, errors that cause the Realm Object Server...
Read more >
RealmSwift Repo for Podspec - App Development
I am trying to build an app with RealmSwift and SwiftUI. Using ios 13.3 and Xcode 11.3. I was successful in installing cocoapods....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found