Realm-java: com.getkeepsafe.relinker.MissingLibraryException: lib/armeabi-v7a/librealm-jni.so

Created on 22 Sep 2016  路  55Comments  路  Source: realm/realm-java

This is my second topic about same issue, no one saw https://github.com/realm/realm-java/issues/3447

In my app, the only native library is realm's librealm-jni.so, and seems like this is not cure for me couldnt-load-librealm-jniso

I'm still getting crash logs related this issue. How can i deal with this issue ?

Goal

To find a solution for ABI related problems

Expected Results

To run all split versions of app successfully

Actual Results

Caused by: com.getkeepsafe.relinker.MissingLibraryException: lib/armeabi-v7a/librealm-jni.so
at com.getkeepsafe.relinker.ApkLibraryInstaller.installLibrary(ApkLibraryInstaller.java:85)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:182)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:140)
at com.getkeepsafe.relinker.ReLinker.loadLibrary(ReLinker.java:70)
at com.getkeepsafe.relinker.ReLinker.loadLibrary(ReLinker.java:51)
at io.realm.internal.RealmCore.loadLibrary(RealmCore.java:87)
at io.realm.RealmConfiguration$Builder.(RealmConfiguration.java:390)

Version of Realm and tooling

Realm version(s): 1.2.0

Android Studio version: 2.2

T-Bug

Most helpful comment

@Zhuinden I got same problem when I upgrade realm 1.1.0 to 2.2.1.'Realm 2.x doesn't support regular 'armeabi' (yet) so if you have abiSplit for armeabi then you should probably remove it' is correct.And the answer is
ndk { abiFilters 'armeabi-v7a' }
or
ndk { abiFilters 'armeabi' ,'armeabi-v7a' }
in build.gradle file.

All 55 comments

@blackkara Sorry we are a bit busy recently, so the reply is quite slow.

On what kind of device do you get this crash?

Info moved from #3447

Goal

To find a solution for abi related problems

Expected Results

To run all split versions of app successfully

Actual Results

Crashlytics http://crashes.to/s/25d21237c1a

Fatal Exception: java.lang.RuntimeException: Unable to create application com.blackkara.mockation.MockerApp: com.b.a.b: lib/armeabi-v7a/librealm-jni.so at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3957) at android.app.ActivityThread.access$1300(ActivityThread.java:123) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1185) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4424) at java.lang.reflect.Method.invokeNative(Method.java) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) at dalvik.system.NativeStart.main(NativeStart.java)

Version of Realm and tooling

Realm version(s): 1.2.0

Android Studio version: 2.1.3

Which Android version and device: Related values could be seen in the Crashlytics above link

My Question

I saw a related link https://github.com/realm/realm-java/issues/3175 about this issue, but they are saying that user(s) trying to install an split version of app on wrong device manually.

  1. Does converting to universal app instead of split version make sense ?
  2. After first step, all devices on market can open the app ?

I had opened a topic on stackoverflow probably related to my issue too, really don't know what i did wrong.

I'm even started getting this "Couldn鈥檛 load librealm-jni.so" error on my real test devices (previously they were working)

Thanks for interest

uh, you are using ABI split. Would you please give us some detailed information about those device models? There is a chance if those devices doesn't support armeabi-v7a and accidentally installed the armeabi-v7a version from some where (a 3rd party store maybe?)

And the question on stackoverflow is solved I think? I am confused, it seems not related with the question here.

For example this is my one of the real test devices. Before i never get an error from this device, but now getting.

Device : Samsung GT-P3105
Processor : ARMv7 Processor rev 3 (v7l)
Caused by: com.getkeepsafe.relinker.MissingLibraryException: lib/armeabi-v7a/librealm-jni.so at com.getkeepsafe.relinker.ApkLibraryInstaller.installLibrary(ApkLibraryInstaller.java:85) at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:182) at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:140) at com.getkeepsafe.relinker.ReLinker.loadLibrary(ReLinker.java:70) at com.getkeepsafe.relinker.ReLinker.loadLibrary(ReLinker.java:51) at io.realm.internal.RealmCore.loadLibrary(RealmCore.java:87) at io.realm.RealmConfiguration$Builder.<init>(RealmConfiguration.java:390)

An important thing, if i remove whole split section from gradle, then it works on this device

good! so you can actually reproduce it!
So what apk did you installed on the device? If you have root permission, you can find it in
/data/app/<package name>/
also, would you please list the files under that directory? simply by

cd /data/app/<package name>
find .

I am at a loss for words, now all real test devices working.

But couldn't find a solution for crashes on crashlytics

There is a chance if those devices doesn't support armeabi-v7a

1) Why non-armeabi-v7a devices install this ABI split from market ?

2) I'm publishing already for those ABIs ('x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'mips') So is there any other kind of ABI should i add here ?

3) If i turn back to single apk (universal) instead of split, is it possible to get ""Couldn鈥檛 load librealm-jni.so" errors still ?

3) If i turn back to single apk (universal) instead of split, is it possible to get ""Couldn鈥檛 load librealm-jni.so" errors still ?

Only if you have another native library in your code, one that doesn't support 64-bit. But that would be a whole different problem altogether.

Personally I haven't had this kind of crash at all and the production app also uses Relinker.

@Zhuinden In my case, the only native library is librealm-jni.so

So, can i say that converting to single APK could solve this issue for me ?

I think so!

Seems like the only way to get rid of this issue is switching to single APK for me. Thanks @Zhuinden

@blackkara Would you please do a adb shell getprop on Samsung GT-P3105 and post the results here?

And also, seems https://github.com/KeepSafe/ReLinker/commit/079eef03c51f33fbda56f40fff31a564a583c412 this will fix some problems as well.

I will update relinker to 1.2.2

@blackkara We upgraded to Relinker 1.2.2. Can you try to use 2.0.0-SNAPSHOT to see if this fixes your problem?

https://github.com/realm/realm-java#using-snapshots

@beeender, the result of Samsung GT-P3105

[dalvik.vm.dexopt-flags]: [m=y]
[dalvik.vm.heapgrowthlimit]: [48m]
[dalvik.vm.heapsize]: [256m]
[dalvik.vm.heapstartsize]: [5m]
[dalvik.vm.stack-trace-file]: [/data/anr/traces.txt]
[dev.MDPLimitCondition]: [0]
[dev.bootcomplete]: [1]
[dev.kiessupport]: [TRUE]
[dhcp.wlan0.dns1]: [192.168.1.1]
[dhcp.wlan0.dns2]: []
[dhcp.wlan0.dns3]: []
[dhcp.wlan0.dns4]: []
[dhcp.wlan0.gateway]: [192.168.1.1]
[dhcp.wlan0.ipaddress]: [192.168.1.42]
[dhcp.wlan0.leasetime]: [3600]
[dhcp.wlan0.mask]: [255.255.255.0]
[dhcp.wlan0.pid]: [1035]
[dhcp.wlan0.reason]: [RENEW]
[dhcp.wlan0.result]: [ok]
[dhcp.wlan0.server]: [192.168.1.1]
[dhcp.wlan0.vendorInfo]: []
[gsm.current.phone-type]: [1]
[gsm.network.type]: [HSDPA]
[gsm.operator.alpha]: []
[gsm.operator.iso-country]: [tr]
[gsm.operator.isroaming]: [false]
[gsm.operator.numeric]: [28603]
[gsm.sim.operator.alpha]: []
[gsm.sim.operator.iso-country]: []
[gsm.sim.operator.numeric]: []
[gsm.sim.state]: [ABSENT]
[gsm.version.baseband]: [P3105JVCLK1]
[gsm.version.ril-impl]: [Samsung RIL(IPC) v2.0]
[hwui.render_dirty_regions]: [false]
[init.svc.BCS-daemon]: [running]
[init.svc.DR-daemon]: [running]
[init.svc.DTT-daemon]: [running]
[init.svc.KIES-daemon]: [running]
[init.svc.SMD-daemon]: [running]
[init.svc.adbd]: [running]
[init.svc.cpboot-daemon]: [running]
[init.svc.dbus]: [running]
[init.svc.debuggerd]: [running]
[init.svc.dhcpcd_wlan0]: [running]
[init.svc.dock_kbd_attach]: [running]
[init.svc.drm]: [running]
[init.svc.flash_recovery]: [stopped]
[init.svc.geomagneticd]: [running]
[init.svc.gpsd]: [running]
[init.svc.icd]: [stopped]
[init.svc.installd]: [running]
[init.svc.iprenew_wlan0]: [stopped]
[init.svc.keystore]: [running]
[init.svc.macloader]: [stopped]
[init.svc.media]: [running]
[init.svc.mobex-daemon]: [running]
[init.svc.netd]: [running]
[init.svc.orientationd]: [running]
[init.svc.p2p_supplicant]: [running]
[init.svc.powersnd]: [stopped]
[init.svc.pvrsrvctl]: [stopped]
[init.svc.pvrsrvinit]: [stopped]
[init.svc.ril-daemon]: [running]
[init.svc.samsungani]: [stopped]
[init.svc.sdcard]: [running]
[init.svc.servicemanager]: [running]
[init.svc.smc_pa]: [stopped]
[init.svc.surfaceflinger]: [running]
[init.svc.tf_daemon]: [running]
[init.svc.ueventd]: [running]
[init.svc.vold]: [running]
[init.svc.wpa_supplicant]: [running]
[init.svc.zygote]: [running]
[keyguard.no_require_sim]: [true]
[media.enable-commonsource]: [true]
[net.bt.name]: [Android]
[net.change]: [net.dnschange]
[net.dns1]: [192.168.1.1]
[net.dnschange]: [1]
[net.hostname]: [android-8db20335786ecdf1]
[net.qtaguid_enabled]: [1]
[net.rmnet0.dns1]: []
[net.rmnet0.dns2]: []
[net.rmnet0.gw]: []
[net.rmnet1.dns1]: []
[net.rmnet1.dns2]: []
[net.rmnet1.gw]: []
[net.rmnet2.dns1]: []
[net.rmnet2.dns2]: []
[net.rmnet2.gw]: []
[net.streaming.rtsp.uaprof]: [http://wap.samsungmobile.com/uaprof/]
[net.tcp.buffersize.default]: [4096,87380,110208,4096,16384,110208]
[net.tcp.buffersize.edge]: [4093,26280,35040,4096,16384,35040]
[net.tcp.buffersize.evdo_b]: [4094,87380,262144,4096,16384,262144]
[net.tcp.buffersize.gprs]: [4092,8760,11680,4096,8760,11680]
[net.tcp.buffersize.hsdpa]: [4092,87380,704512,4096,16384,110208]
[net.tcp.buffersize.hspa]: [4092,87380,704512,4096,16384,262144]
[net.tcp.buffersize.hspap]: [4092,87380,704512,4096,16384,262144]
[net.tcp.buffersize.hsupa]: [4092,87380,704512,4096,16384,262144]
[net.tcp.buffersize.lte]: [524288,1048576,2560000,262144,524288,1220608]
[net.tcp.buffersize.umts]: [4094,87380,110208,4096,16384,110208]
[net.tcp.buffersize.wifi]: [524288,1048576,2097152,262144,524288,1048576]
[net.wlan0.dns1]: [49.0.0.0]
[net.wlan0.dns2]: []
[persist.audio.allsoundmute]: [0]
[persist.audio.headsetsysvolume]: [4]
[persist.audio.hphonesysvolume]: [4]
[persist.audio.ringermode]: [2]
[persist.audio.sysvolume]: [4]
[persist.sys.country]: [TR]
[persist.sys.flipfontpath]: [default]
[persist.sys.language]: [tr]
[persist.sys.localevar]: []
[persist.sys.profiler_ms]: [0]
[persist.sys.storage_preload]: [2]
[persist.sys.timezone]: [Europe/Istanbul]
[persist.sys.usb.config]: [mtp,adb]
[ril.CardSlotStatus]: [0]
[ril.FS]: [false]
[ril.ICC_TYPE]: [0]
[ril.RildInit]: [1]
[ril.approved_codever]: [none]
[ril.approved_cscver]: [none]
[ril.approved_modemver]: [none]
[ril.barcode]: []
[ril.cbd.boot_done]: [1]
[ril.cbd.rfs_check_done]: [1]
[ril.ecclist0]: [112,911,999,000,08,110,118,119]
[ril.hw_ver]: [MP 0.800]
[ril.model_id]: [P3105]
[ril.official_cscver]: [P3105TURCLL2]
[ril.product_code]: [GT-P3105TSETUR]
[ril.rfcal_date]: [2012.9.12]
[ril.sales_code]: [TUR]
[ril.serialnumber]: [RF1C93JF09M]
[ril.sw_ver]: [P3105JVCLK1]
[ril.tethering.usb.active]: [0]
[ril.timezoneID]: [Europe/Istanbul]
[rild.libargs]: [-d /dev/ttys0]
[rild.libpath]: [/system/lib/libsec-ril.so]
[ro.adb.qemud]: [1]
[ro.allow.mock.location]: [0]
[ro.baseband]: [unknown]
[ro.board.platform]: [omap4]
[ro.boot.debug_level]: [0x4f4c]
[ro.boot.mode]: [power_key]
[ro.boot.serialno]: [c1607a610fa508f]
[ro.bootloader]: [unknown]
[ro.bootmode]: [power_key]
[ro.bt.bdaddr_path]: [/efs/bluetooth/bt_addr]
[ro.build.PDA]: [P3105JVCMA2]
[ro.build.changelist]: [825208]
[ro.build.characteristics]: [tablet]
[ro.build.date.utc]: [1357901906]
[ro.build.date]: [Fri Jan 11 19:58:26 KST 2013]
[ro.build.description]: [espressorfjt-user 4.1.2 JZO54K P3105JVCMA2 release-keys]
[ro.build.display.id]: [JZO54K.P3105JVCMA2]
[ro.build.fingerprint]: [samsung/espressorfjt/espressorf:4.1.2/JZO54K/P3105JVCMA2:user/release-keys]
[ro.build.hidden_ver]: [P3105JVCMA2]
[ro.build.host]: [HP18]
[ro.build.id]: [JZO54K]
[ro.build.product]: [espressorf]
[ro.build.tags]: [release-keys]
[ro.build.type]: [user]
[ro.build.user]: [dpi]
[ro.build.version.codename]: [REL]
[ro.build.version.incremental]: [P3105JVCMA2]
[ro.build.version.release]: [4.1.2]
[ro.build.version.sdk]: [16]
[ro.carrier]: [unknown]
[ro.chipname]: [OMAP4430]
[ro.com.android.dateformat]: [MM-dd-yyyy]
[ro.com.google.apphider]: [off]
[ro.com.google.clientidbase]: [android-samsung]
[ro.com.google.gmsversion]: [4.1_r4]
[ro.config.alarm_alert]: [Good_Morning.ogg]
[ro.config.media_sound]: [Media_preview_Touch_the_light.ogg]
[ro.config.notification_sound]: [S_Whistle.ogg]
[ro.config.ringtone]: [S_Over_the_horizon.ogg]
[ro.crypto.fuse_sdcard]: [true]
[ro.crypto.state]: [unencrypted]
[ro.csc.country_code]: [TURKEY]
[ro.csc.countryiso_code]: [TR]
[ro.csc.sales_code]: [TUR]
[ro.debug_level]: [0x4f4c]
[ro.debuggable]: [0]
[ro.emmc_checksum]: [3]
[ro.error.receiver.default]: [com.samsung.receiver.error]
[ro.factorytest]: [0]
[ro.hardware]: [espresso]
[ro.hdcp2.rx]: [tz]
[ro.kernel.qemu]: [0]
[ro.lcd_brightness]: [140]
[ro.opengles.version]: [131072]
[ro.product.board]: [piranha]
[ro.product.brand]: [samsung]
[ro.product.cpu.abi2]: [armeabi]
[ro.product.cpu.abi]: [armeabi-v7a]
[ro.product.device]: [espressorf]
[ro.product.locale.language]: [en]
[ro.product.locale.region]: [GB]
[ro.product.manufacturer]: [samsung]
[ro.product.model]: [GT-P3105]
[ro.product.name]: [espressorfjt]
[ro.product.processor]: [omap4430]
[ro.product_ship]: [true]
[ro.revision]: [10]
[ro.ril.gprsclass]: [10]
[ro.ril.hsxpa]: [1]
[ro.runtime.firstboot]: [1474903187532]
[ro.sec.fle.encryption]: [true]
[ro.secure]: [1]
[ro.serialno]: [c1607a610fa508f]
[ro.setupwizard.mode]: [DISABLED]
[ro.sf.hwrotation]: [270]
[ro.sf.lcd_density]: [160]
[ro.url.legal.android_privacy]: [http://www.google.com/intl/%s/mobile/android/basic/privacy.html]
[ro.url.legal]: [http://www.google.com/intl/%s/mobile/android/basic/phone-legal.html]
[ro.wifi.channels]: []
[service.bootanim.exit]: [1]
[service.media.powersnd]: [1]
[sys.boot_completed]: [1]
[sys.service_manager_ready]: [1]
[sys.settings_system_version]: [87]
[sys.usb.config]: [mtp,adb]
[sys.usb.state]: [mtp,adb]
[system_init.startsurfaceflinger]: [0]
[telephony.lteOnCdmaDevice]: [0]
[vold.post_fs_data_done]: [1]
[wifi.interface]: [wlan0]
[wlan.driver.status]: [ok]
[wlan.wfd.status]: [disconnected]

Firstly, let me telling a little story

I'm having a painful issue on my android studio. I have a few devices that have different architectures(as might be expected). And i can run the app on these devices. But after a time, when i try to run the app on these devices again (via android studio's run button), studio sends wrong apk distribution. As a result, i'm getting the librealm-jni.so error.

http://stackoverflow.com/questions/39727835/android-studio2-2-sends-wrong-abi-split-to-device

So, the above mentioned my test device (Samsung GT-P3105), could face this issue due to studio's weird behavior.

The story finished.

Now, i have tried 1.2.0 and 2.0.0-SNAPSHOT versions. They worked perfectly on my test devices. But i have to consider devices that face librealm-jni.so related issues on market.

librealm-jni.so related issue
librealm-jni.so related issue
librealm-jni.so related issue

I got a problem the same as you , so , did you solve it?

@Botasky369 I couldn't find and make any reasonable cure for devices on market (mentioned above in crashlytic links)

I'll just update realm version to 2.0.0 on my app, then wait to get less librealm-jni.so related crashes.

@blackkara OK, thanks

@blackkara you should wait until 2.0.1

2.0.1 has been released

The same error occurs after upgrading from v1.2.0 to v2.0.x.

I tried both v2.0.1 and v2.0.2, but did not solved this issue.

Info

Android Studio version: 2.2

I didn't upgrade realm on my app, after i will share feedback here. Thanks @cmelchior, @Zhuinden

@kuno Are you getting this issue from users(market etc) or your test devices ? If test devices, i suggest you checking this link. Because, when you press the start button from android studio, it sends wrong abi split to device

Hello,

Im getting the same error on Fabric with realm 1.2.0 and Im using APK SPLIT

Fatal Exception: java.lang.RuntimeException: Unable to create application com.cashdivider.app.application.CashdividerApp: com.c.a.b: lib/armeabi-v7a/librealm-jni.so
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3957)
at android.app.ActivityThread.access$1300(ActivityThread.java:123)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1185)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(NativeStart.java)
Caused by com.c.a.b: lib/armeabi-v7a/librealm-jni.so
at com.getkeepsafe.relinker.ApkLibraryInstaller.installLibrary(SourceFile:85)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(SourceFile:182)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(SourceFile:140)
at com.getkeepsafe.relinker.ReLinker.loadLibrary(SourceFile:70)
at com.getkeepsafe.relinker.ReLinker.loadLibrary(SourceFile:51)
at io.realm.internal.RealmCore.loadLibrary(SourceFile:87)
at io.realm.RealmConfiguration$Builder.(SourceFile:390)
at com.cashdivider.app.task.RealmUtils.getRealmConfig(SourceFile:69)
at com.cashdivider.app.task.RealmUtils.initRealmAPI(SourceFile:181)
at com.cashdivider.app.task.RealmUtils.initRealmAPI(SourceFile:164)
at com.cashdivider.app.application.CashdividerApp.getRealmNewInstance(SourceFile:209)
at com.cashdivider.app.task.DailyReminderTask.isDailyNotification(SourceFile:178)
at com.cashdivider.app.task.DailyReminderTask.initTask(SourceFile:55)
at com.cashdivider.app.application.CashdividerApp.onCreate(SourceFile:123)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:969)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3954)
at android.app.ActivityThread.access$1300(ActivityThread.java:123)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1185)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(NativeStart.java)

Is this been fixed? If yes, in which version? Or what I can do? Thank you

@cotfas Check out this link http://stackoverflow.com/questions/39727835/android-studio2-2-0-and-2-2-1-sends-wrong-abi-split-to-device

I was getting the same error. I just rebuilt my project and ran my app again, it sorted it out.

@AmitBarjatya

Can you tell me what version of Android do you use?

And what gradle version?

Thank you

My gradle version is 2.2.1, Android Studio 2.2.1; also Realm 2.0.2
A moto-g device running Android L (SDK 22)- armeabi-v7 that is

@AmitBarjatya

When I`m trying to build all APK I am not able to do that with gradle version 2.2.1 or 2.2.2 (by build all apk, I mean try to run the project and after it has been executed, in the apk folder I can only see the APK for the abi emulator on what it was opened/runed)

I only can build all APK`s with 2.2.0 (which I will get the same bug with ABI mismatch)

Did you face this problem as well? How did you managed to solve it? Thank you!

@cotfas
No. I only tried with actual devices and not emulators. So I am not really sure how it behaves on emulated devices.

PS: I ran into this issue again. Had to rebuild&run it 4-5 times to get it working.

Same problem here, happening on devices.

Realm 2.x doesn't support regular 'armeabi' (yet) so if you have abiSplit for armeabi then you should probably remove it

Or just stick to Realm 1.1.1 or 1.2.0 in the meantime

@Zhuinden How often armeabi is used or how many devices uses this abi?

@ppamorim armeabi itself isn't really used, but sometimes there are other native libraries that don't have armeabi-v7 in which case the removal of it in Realm 2.x causes problems.

There is an issue tracking it here https://github.com/realm/realm-java/issues/3506 but it'll take a while, I think.

If you read above, you'll see that abiSplits themselves seem to be sometimes unreliable when you install it on the device, as you can for some weird reason get the wrong abi.

@Zhuinden Thank you for the explanation, you solved my problem and everything is working now.

@ppamorim I... did? What was the fix?

@Zhuinden I got same problem when I upgrade realm 1.1.0 to 2.2.1.'Realm 2.x doesn't support regular 'armeabi' (yet) so if you have abiSplit for armeabi then you should probably remove it' is correct.And the answer is
ndk { abiFilters 'armeabi-v7a' }
or
ndk { abiFilters 'armeabi' ,'armeabi-v7a' }
in build.gradle file.

Hi there, just chiming in:

com.getkeepsafe.relinker.MissingLibraryException: lib/armeabi-v7a/librealm-jni.so means your APK does not have librealm-jni.so packaged. This is a packaging problem, please ensure your ABI splits are working properly and they each have librealm-jni.so for their respective platforms.

I tend to agree with @xiphirx. This sounds like a packaging problem. We have upgraded to latest version of Relinker (1.2.2) and we are adding support for armeabi back through #3506. I don't think there is much more we can do at this point.

Closing.

Randomly seeing this lately :( Not using ABI splits, and a clean & build fixes it.

On Android Studio 3.0 Beta 6.
Happens once for every ~15 hours of programming.

Let me know if you need any more details.

@zoltish

  1. which device are you testing with?
  2. Do you have other native libraries? Do you load all native so files on the same thread?

@beeender

  1. Google Pixel on API 26 (Emulator)
  2. No other native libs!

@zoltish

  1. x86 emulator?
  2. Do you use instant run?
  3. Can you help to get a full log when that happens? You can send it to [email protected] if it contains sensitive data.
  4. When that happens, would you please use adb to get below information:
adb shell
ls -l /data/data/your.package.name
ls -l /data/data/your.package.name/lib

@beeender

  1. x64
  2. Nope
  3. Ill include it the next time it happens, the log was cleared when I reran it unfortunately.
  4. Same as 3!

We have a situation like that of @zoltish . We don't use instant run.
AS - Android Studio 3.0 Beta 6
Realm version - 4.0.0-BETA3-SNAPSHOT
our devices - Nexus 5x, Nexus 9, Lenovo tab 2 a7

@toktogul but do you use AbiSplits?

we don't use

@beeender Seems that I am running on a x86 device after all, my mistake.

ADB:

generic_x86:/ # ls -l /data/data/progression2.debug
total 24
drwxrwx--x 2 u0_a86 u0_a86       4096 2017-09-27 12:51 app_lib
drwxrws--x 2 u0_a86 u0_a86_cache 4096 2017-09-25 08:17 cache
drwxrws--x 2 u0_a86 u0_a86_cache 4096 2017-09-25 08:17 code_cache
drwxrwx--x 4 u0_a86 u0_a86       4096 2017-09-25 08:17 files
lrwxrwxrwx 1 root   root           61 2017-09-29 13:04 lib -> /data/app/progression2.debug-juFlAaab5hm61rZWoTFbtg==/lib/x86
drwxrwx--x 2 u0_a86 u0_a86       4096 2017-09-25 08:17 shared_prefs

generic_x86:/ # ls -l /data/data/progression2.debug/lib
lrwxrwxrwx 1 root root 61 2017-09-29 13:04 /data/data/progression2.debug/lib -> /data/app/progression2.debug-juFlAaab5hm61rZWoTFbtg==/lib/x86
generic_x86:/ #

Full crash log:

FATAL EXCEPTION: main
                                                        Process: progression2.debug, PID: 4224
                                                        java.lang.RuntimeException: Unable to create application progression.mobile.app.MobileApp: com.getkeepsafe.relinker.MissingLibraryException: lib/x86/librealm-jni.so
                                                            at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5794)
                                                            at android.app.ActivityThread.-wrap1(Unknown Source:0)
                                                            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1661)
                                                            at android.os.Handler.dispatchMessage(Handler.java:105)
                                                            at android.os.Looper.loop(Looper.java:164)
                                                            at android.app.ActivityThread.main(ActivityThread.java:6541)
                                                            at java.lang.reflect.Method.invoke(Native Method)
                                                            at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
                                                            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
                                                         Caused by: com.getkeepsafe.relinker.MissingLibraryException: lib/x86/librealm-jni.so
                                                            at com.getkeepsafe.relinker.ApkLibraryInstaller.installLibrary(ApkLibraryInstaller.java:85)
                                                            at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:180)
                                                            at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:136)
                                                            at com.getkeepsafe.relinker.ReLinker.loadLibrary(ReLinker.java:70)
                                                            at com.getkeepsafe.relinker.ReLinker.loadLibrary(ReLinker.java:57)
                                                            at io.realm.internal.RealmCore.loadLibrary(RealmCore.java:60)
                                                            at io.realm.Realm.init(Realm.java:245)
                                                            at progression.android.datamodel.common.init.InitDataModels$DefaultImpls.initDataModels(InitDataModels.kt:13)
                                                            at progression.mobile.app.MobileApp.initDataModels(MobileApp.kt:16)
                                                            at progression.mobile.app.MobileApp.onCreate(MobileApp.kt:29)
                                                            at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1118)
                                                            at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5791)
                                                            at android.app.ActivityThread.-wrap1(Unknown Source:0)聽
                                                            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1661)聽
                                                            at android.os.Handler.dispatchMessage(Handler.java:105)聽
                                                            at android.os.Looper.loop(Looper.java:164)聽
                                                            at android.app.ActivityThread.main(ActivityThread.java:6541)聽
                                                            at java.lang.reflect.Method.invoke(Native Method)聽
                                                            at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)聽
                                                            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)聽

/data/app/progression2.debug-juFlAaab5hm61rZWoTFbtg==/lib/x86 this directory is empty?? that is strange. That probably means the gradle didn't pack the so files into the apk. Maybe you can check this part?
@zoltish

@beeender Yup, its empty.

@zoltish My guess is there is something wrong with your Android Studio setup ...

@beeender Might be, not that I would know what that might be but I am running the beta version of it after all. Everything works completely fine, with this being the exception every 10-15 hours or so.

@beeender 's answer is right for me. I forget to add the line "jniLibs.srcDirs = ['libs']" in the gradle file.

In some android devices the cpu abi code returns "armabi" as there is not library for that it fails.
https://github.com/KeepSafe/ReLinker/issues/47

I will like to overload it with custom relinker
https://github.com/softwarejoint/ReLinker

so that in case it fails I can specify which jni lib to load, however it is very difficult to override the classpath in build.gradle

what will you guys suggest?
should I log this as a new issue?

@softwarejoint did you try to apply Realm manually (without the plugin) https://realm.io/docs/java/latest#how-do-i-customize-dependecies-defined-by-the-realm-gradle-plugin then exclude the transitive dependency to ReLinker to include yours?

Alternatively, you can build Realm locally & replace with the dependency yourself https://github.com/realm/realm-java#building-realm

Was this page helpful?
0 / 5 - 0 ratings