Realm-java: Native method not found: io.realm.internal.NativeObjectReference.nativeCleanUp

Created on 31 May 2017  路  6Comments  路  Source: realm/realm-java

Goal

I want to create a realm database.

Actual Results

java.lang.UnsatisfiedLinkError
Native method not found: io.realm.internal.NativeObjectReference.nativeCleanUp:(JJ)V
io.realm.internal.NativeObjectReference.void nativeCleanUp(long,long)(Native Method)
io.realm.internal.NativeObjectReference.void cleanup()(NativeObjectReference.java:87)
io.realm.internal.FinalizerRunnable.void run()(FinalizerRunnable.java:38)
java.lang.Thread.run(Thread.java:841)

Steps & Code to Reproduce

It crashes sometimes in android 4.3,4.4

Version of Realm and tooling

Realm version(s): io.realm:realm-gradle-plugin:3.2.0

Realm sync feature enabled: no

Which Android version and device:

VIVO Y27, VIVO Y23L, VIVO X710L, HW Honor CHM-UL00, VIVO X3L

T-Help

Most helpful comment

I loaded the lib in ui thread, and all the operation of the realm I called also in ui thread.It seems I got it fixed.
Thanks.

All 6 comments

It is the 1st time we saw this crash.

  1. Can you reproduce it?
  2. Does it only happen to realm 3.2.0?
  3. Do you have any other native so files in the apk?
  4. Do you use apk split for different ABIs?
  5. Can you share your apk file with us? to [email protected] if you want to share it privately.
  1. I sorry to say that i can't reproduce it.
    2.I only use this version.But i can try to use other version.
    3.Yes, I have some other so in my apk.
    4.armeabi-v7a

I had send email with apk to [email protected].

@kevengithub We haven't received your apk yet, maybe something wrong with the mail server? You can also put it somewhere we can download. thanks!

Hi, I got you apk and there are lots of native so files :)

My guess is there was a concurrency problem with System.loadLibrary() for old version android and which has been fixed in Android 5, see https://android.googlesource.com/platform/libcore/+/a80f9ae%5E!/ .

Also a user reported a similar issue and get it fixed by load all the so files on the same thread, see https://github.com/realm/realm-java/issues/1350#issuecomment-128217691

Would you please help to check if all your so files are loaded on the same thread?

I loaded the lib in ui thread, and all the operation of the realm I called also in ui thread.It seems I got it fixed.
Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pawlo2102 picture pawlo2102  路  3Comments

wezley98 picture wezley98  路  3Comments

gpulido picture gpulido  路  3Comments

harshvishu picture harshvishu  路  3Comments

iAbdulaziz picture iAbdulaziz  路  3Comments