Realm-js: Xcode 10.2 build failure on Realm 2.26.0 and React Native 0.59.4

Created on 12 Apr 2019  路  4Comments  路  Source: realm/realm-js

Goals

I upgraded my project to React Native 0.59 and since then building the project fails.

Expected Results

Successfully built project.

Actual Results

When I run react-native run-ios I receive the following error.

error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building yourapp with Xcode.app, by opening project.xcodeproj

** BUILD FAILED **


The following build commands failed:
        CompileC /Users/me/project/ios/build/dmReactNative57/Build/Intermediates.noindex/RealmJS.build/Debug-iphonesimulator/RealmJS.build/Objects-normal/x86_64/jsc_value.o /Users/me/project/node_modules/realm/src/jsc/jsc_value.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

When I build the project in xcode I get the following errors:
jsc_value.hpp lines 44 through 54


Steps to Reproduce

Add realm 2.26.0 to a react native 0.59.4 project on a mac with xcode 10.2.

Working fix

Simply adding a case kJSTypeSymbol: break; at the end of the switch fixes the problem in Libraries/RealmReact.xcodeproj/Libraries/RealmJS.xcodeproj/RealmJS/JSC/jsc_value.hpp. Though I'm sure this isn't the best way fix.

I'd imagine the correct fix is to add case kJSTypeSymbol: return "symbol"; to the end of the switch case. Like below:

template<>
inline const char *jsc::Value::typeof(JSContextRef ctx, const JSValueRef &value) {
    switch (JSValueGetType(ctx, value)) {
        case kJSTypeNull: return "null";
        case kJSTypeNumber: return "number";
        case kJSTypeObject: return "object";
        case kJSTypeString: return "string";
        case kJSTypeBoolean: return "boolean";
        case kJSTypeUndefined: return "undefined";
        case kJSTypeSymbol: return "symbol";
    }
}

But this is just my guess based on the case name, and the other cases.

Version of Realm and Tooling

  • Realm Version: 2.26.0
  • React Native: 0.59.4
  • Client OS & Version: macOS 10.14.4
  • Xcode Version: 10.2 (10E125)
O-Community T-Help

Most helpful comment

@jgreen01su @sajsanghvi Upgrading to v2.26.1 should solve it.

All 4 comments

exact same problem. Just started happening when upgrading my Xcode

Duplicated issue

Original Issue: https://github.com/realm/realm-js/issues/2246

Solved PR comment: https://github.com/realm/realm-js/pull/2303#issuecomment-482517874

I have just released v2.26.1 with the fix.

By @kneth

@jgreen01su @sajsanghvi Upgrading to v2.26.1 should solve it.

Hey - looks like you forgot to add a T:* label - could you please add one?

Was this page helpful?
0 / 5 - 0 ratings