Realm-java: RealmFileException: Function not implemented in /Users/cm/Realm/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_SharedRealm.cpp line 81 Kind: ACCESS_ERROR.

Created on 2 Nov 2016  路  24Comments  路  Source: realm/realm-java

I get this, it happens on: Android 4.3
Blackberry Leap device.
Realm 2.0.2
Any ideas for a fix?

io.realm.exceptions.RealmFileException: Function not implemented in /Users/cm/Realm/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_SharedRealm.cpp line 81 Kind: ACCESS_ERROR.
at io.realm.internal.SharedRealm.nativeGetSharedRealm(Native Method)
at io.realm.internal.SharedRealm.getInstance(Unknown Source)
at io.realm.internal.SharedRealm.getInstance(Unknown Source)
at io.realm.RealmCache.createRealmOrGetFromCache(Unknown Source)
at io.realm.Realm.getInstance(Unknown Source)

T-Bug-Crash

Most helpful comment

@beeender Please check out the https://github.com/realm/realm-java/issues/3651 Samsung issue while you are doing the blackberry debug. The blackberry android runtime is based on the same horrendous 4.2.2 branch as with the Samsungs. Hopefully you can nab these 2 runaway turkeys with 1 arrow. +Christmas wish.

All 24 comments

Are you saving the Realm on external storage?

The realm file isn't even created, this happens at the execution of getInstance (when realm is supposed to create the realm file because it doesn't exists)

What is your RealmConfiguration?

realmFileName = Realm.DEFAULT_REALM_NAME;
config = new RealmConfiguration.Builder()
.name(realmFileName)
.schemaVersion(versionSchema)
.encryptionKey(key)
.migration(new MigrationRealm())
.build();

@beeender Blackberry is broken again

@matomick Try again by disabling encryption. Run again without the ".encryptionKey(key)" part. At least this can exclude the encryption code path.

Same thing happened here. From the log Fabric collected for me, I only saw this error happened on Blackberry's device(e.g, Passport ).

Also, I am currently running realm version 2.0.2 on my app.

More detail with log:

Fatal Exception: io.realm.exceptions.RealmFileException: Function not implemented in /Users/cm/Realm/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_SharedRealm.cpp line 81
       at io.realm.internal.SharedRealm.nativeGetSharedRealm(SharedRealm.java)
       at io.realm.internal.SharedRealm.getInstance(SharedRealm.java:178)
       at io.realm.internal.SharedRealm.getInstance(SharedRealm.java:155)
       at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:124)
       at io.realm.Realm.getInstance(Realm.java:228)

@Anthonyeef @matomick Is it 100 % reproducible?

@kneth I don't have Blackberry device for testing now. But from the log collected by Fabric, I believe this happened quite often. About 6 Blackberry devices failed at this issue 51 times from last Friday.

I am looking for a Blackberry running Android OS now trying to reproduce this issue myself. Wish it won't cause a sudden crash or anything weird.

@Anthonyeef Please post an update when you have tried on a real device.

One of my user gave me feedback this morning. She is using Blackberry Passport, and my app crashed immediately when trying to get instance of Realm.
Log is the same as I post before, Function not implemented in /Users/cm/Realm/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_SharedRealm.cpp line 81

We need to get an extra Blackberry device at office so we can debug it.

Hope to hear any fix from upstream.

@kneth any update ?

We have never officially support Blackberry devices, and their Android runtime environment is incomplete. Therefore we cannot guarantee that Realm Java will work. Please see https://realm.io/docs/java/latest/#blackberry-devices.

@kneth that's quite rough.

I guess sticking with Realm 1.1.1 or 1.2.0 is the way to go in this case in the meantime.

Documenting the fact that it doesn't work doesn't fix the fact that apparently the realm-object-store is inconsistent and unreliable across devices that run the Android platform, and apparently Realm is not willing to fix their own bug.

This is not a good thing. This issue should not be closed. After all, it is not fixed.

You could say "We didn't officially say we support Samsung Galaxy Tab 3 Lite 7, so we are not fixing compatibility issues with it", but that would just mean Realm will remain an "unreliable platform".

You should not close this issue. It is not a closed issue.

@Zhuinden I will look into it ...

@beeender sorry about the extra work, but this would have been pretty bad for Realm

This happened with the Realm 1.x -> 2.x shift, so it ought to be something in how the Realm Object Store opens the instance.

I don't have a Blackberry device so I can't look into it myself...

The blackberry doesn't support all function calls of the NDK, and the worse thing is it is not documented well and native debugging is extremely time consuming on BB devices ... anyway, i will try to prioritize this.

@beeender Please check out the https://github.com/realm/realm-java/issues/3651 Samsung issue while you are doing the blackberry debug. The blackberry android runtime is based on the same horrendous 4.2.2 branch as with the Samsungs. Hopefully you can nab these 2 runaway turkeys with 1 arrow. +Christmas wish.

This issues was gone in realm-java v2.1.0 and blackberry also works fine with the latest snapshot 2.3.0-snapshot.

After wasting hours to figure out the root cause, the BB z10 reminded me again and again why did I hate this device that much:

  • no backtrace for Android native crash
  • Of course no gdb to debug a Android app
  • Even the _Unwind_Backtrace() doesn't work as expected
  • so file cannot be found randomly
  • etc..

I stopped to investigate the root cause for now. Anyway, this problem should be gone for realm-java version >= v2.1.0 .

I'm using Realm 6.0.2 and got this error on brand RIM model Passport and android 4.3:

Fatal Exception: io.realm.exceptions.RealmError: Unrecoverable error. Function not implemented in /Users/cm/Realm/realm-java-release/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 101
       at io.realm.internal.OsSharedRealm.nativeGetSharedRealm(OsSharedRealm.java)
       at io.realm.internal.OsSharedRealm.<init>(OsSharedRealm.java)
       at io.realm.internal.OsSharedRealm.getInstance(OsSharedRealm.java)
       at io.realm.internal.OsSharedRealm.getInstance(OsSharedRealm.java)
       at io.realm.RealmCache.copyFileIfNeeded(RealmCache.java)
       at io.realm.RealmCache.access$900(RealmCache.java)
       at io.realm.Realm.beginTransaction(Realm.java)

Device
Brand: RIM
Model: Passport
Orientation: Portrait
RAM free: 1.08 GB
Disk free: 13.94 GB

Operating System
Version: 4.3
Orientation: Portrait
Rooted: No

Blackberry is dead.

Was this page helpful?
0 / 5 - 0 ratings