Realm-java: Build crashes : 'class realm::Object' has no member named 'add_notification_callback'

Created on 8 May 2017  路  2Comments  路  Source: realm/realm-java

I forked the repo at v3.0.0. Build process used to work perfectly. Now I want to merge the updates. But I'm no more able to build. Even when I checkout v3.1.4 on upstream repo, I experience the same error when executing ./gradlew assmble

:realm:realm-library:externalNativeBuildBaseDebug
Build realm-jni arm64-v8a
[1/51] Building C header files from classes...
[2/51] Building CXX object CMakeFiles/realm-jni.dir/io_realm_OsRealmObjectSchema.cpp.o
[3/51] Building CXX object CMakeFiles/realm-jni.dir/io_realm_OsRealmSchema.cpp.o
[4/51] Building CXX object CMakeFiles/realm-jni.dir/io_realm_Property.cpp.o
[5/51] Building CXX object CMakeFiles/realm-jni.dir/io_realm_internal_CheckedRow.cpp.o
[6/51] Building CXX object CMakeFiles/realm-jni.dir/io_realm_internal_Collection.cpp.o
[7/51] Building CXX object CMakeFiles/realm-jni.dir/io_realm_internal_CollectionChangeSet.cpp.o
[8/51] Building CXX object CMakeFiles/realm-jni.dir/io_realm_internal_LinkView.cpp.o
[9/51] Building CXX object CMakeFiles/realm-jni.dir/io_realm_internal_NativeObjectReference.cpp.o
[10/51] Building CXX object CMakeFiles/realm-jni.dir/io_realm_internal_OsObject.cpp.o
[11/51] Building CXX object CMakeFiles/realm-jni.dir/io_realm_internal_SharedRealm.cpp.o
[12/51] Building CXX object CMakeFiles/realm-jni.dir/io_realm_internal_Table.cpp.o
[13/51] Building CXX object CMakeFiles/realm-jni.dir/io_realm_internal_TableQuery.cpp.o
[14/51] Building CXX object CMakeFiles/realm-jni.dir/io_realm_internal_TestUtil.cpp.o
FAILED: /Users/rjoie/Library/Android/ndk/android-ndk-r10e/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/aarch64-linux-android-g++   -DANDROID -Drealm_jni_EXPORTS -isystem /Users/rjoie/Library/Android/ndk/android-ndk-r10e/platforms/android-21/arch-arm64/usr/include -isystem /Users/rjoie/Library/Android/ndk/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /Users/rjoie/Library/Android/ndk/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/include -isystem /Users/rjoie/Library/Android/ndk/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/backward -I/Users/rjoie/Webiteasy/labo/android/realm-wie/realm/realm-library/distribution/realm-core/core-1.6.0/include -I/Users/rjoie/Webiteasy/labo/android/realm-wie/realm/realm-library/src/main/cpp -I/./Users/rjoie/Webiteasy/labo/android/realm-wie/realm/realm-library/.externalNativeBuild/cmake/baseDebug/arm64-v8a/jni_include -I/Users/rjoie/Webiteasy/labo/android/realm-wie/realm/realm-library/src/main/cpp/object-store/src -fexceptions -frtti -Wno-psabi --sysroot=/Users/rjoie/Library/Android/ndk/android-ndk-r10e/platforms/android-21/arch-arm64 -funwind-tables -fsigned-char -no-canonical-prefixes -fdata-sections -ffunction-sections -Wa,--noexecstack   -DREALM_WRAP_MEMMOVE=0 -DREALM_ANDROID -DREALM_HAVE_CONFIG -DPIC -pthread -fvisibility=hidden -std=c++14 -fsigned-char -Werror -Wall -Wextra -pedantic -Wmissing-declarations     -Wempty-body -Wparentheses -Wunknown-pragmas -Wunreachable-code     -Wno-missing-field-initializers  -Wno-maybe-uninitialized -Wno-uninitialized  -ggdb -Og -DNDEBUG -fPIC -MD -MT CMakeFiles/realm-jni.dir/io_realm_internal_OsObject.cpp.o -MF CMakeFiles/realm-jni.dir/io_realm_internal_OsObject.cpp.o.d -o CMakeFiles/realm-jni.dir/io_realm_internal_OsObject.cpp.o -c /Users/rjoie/Webiteasy/labo/android/realm-wie/realm/realm-library/src/main/cpp/io_realm_internal_OsObject.cpp
/Users/rjoie/Webiteasy/labo/android/realm-wie/realm/realm-library/src/main/cpp/io_realm_internal_OsObject.cpp: In function 'void Java_
io_realm_internal_OsObject_nativeStartListening(JNIEnv*, jobject, jlong)':
/Users/rjoie/Webiteasy/labo/android/realm-wie/realm/realm-library/src/main/cpp/io_realm_internal_OsObject.cpp:192:59: error: 'class realm::Object' has no member named 'add_notification_callback'
         wrapper->m_notification_token = wrapper->m_object.add_notification_callback(ChangeCallback(wrapper));
                                                           ^
ninja: build stopped: subcommand failed.
:realm:realm-library:externalNativeBuildBaseDebug FAILED
:installRealm FAILED

I'm building on OSX 10.12, directly from terminal. Right after this crash, I do a git checkout master to go back on my branch then ./gradlew assemble and everything works well.

T-Help

Most helpful comment

Amazing, thank you ! It fixed the build issue.

All 2 comments

try git submodule update --init first . You might need to delete realm/realm-library/.externalNativeBuild and rebuild.

Amazing, thank you ! It fixed the build issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pawlo2102 picture pawlo2102  路  3Comments

AAChartModel picture AAChartModel  路  3Comments

wezley98 picture wezley98  路  3Comments

David-Kuper picture David-Kuper  路  3Comments

gpulido picture gpulido  路  3Comments