Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Realm crashed in cpu arm64-v8a #5651

Closed
koukoucai opened this issue Jan 2, 2018 · 5 comments
Closed

Realm crashed in cpu arm64-v8a #5651

koukoucai opened this issue Jan 2, 2018 · 5 comments
Labels

Comments

@koukoucai
Copy link

Goal

The realm int our app in some cpu like arm64-v8a was crashed.

Expected Results

No crash

Actual Results

Crash

Steps & Code to Reproduce


First the image is realm3.5.0 so files model.


Second the image is my program's so files model.

Because the there is no so in realm'armeabi . The program builded failed with

Realm relinker.MissingLibraryException: lib/armeabi/librealm-jni.so,g.UnsatisfiedLinkError:

My solution is that copying so file from realm/3.5.0/jni/armeabi-v7a/librealm-jni.so to my program ' jniLibs/armeabi/

The result is app crashed in cpu arm64-v8a and some cpu armeabi-v7a.

I don't know how to solve this problem.

I would send the apk to help@realm.io

Thanks.

Version of Realm and tooling

Realm version(s): 3.5.0

Realm sync feature enabled: yes

Android Studio version: 3.0.1

Which Android version and device: android version 4.4-7.0

@Zhuinden
Copy link
Contributor

Zhuinden commented Jan 2, 2018

Have you considered excluding the armeabi versions of the other native libs? armeabi is deprecated in the latest NDK anyways.

@cmelchior
Copy link
Contributor

I see you have a number of other native libraries. Most likely some of these do not come in 64 bit variants. Android has a hard time with libraries that do not support the same set of architectures.

So either you need to add the missing 64 bit variants for your other dependencies or alternatively remove the 64 bit Realm binaries, but note that ARM is decprecated on Android and that the 64 bit variants have better performance and less battery drain, so using those if possible would be preferable.

@Zhuinden
Copy link
Contributor

Zhuinden commented Jan 3, 2018

And later Google Play will only allow native libraries that provide both 32bit and 64bit

@koukoucai
Copy link
Author

Crash Info

#59338 SIGABRT
#5 pc 0012bb6b /data/app/com.greenline.guahao-1/lib/arm/librealm-jni.so [armeabi-v7a]
#00 pc 0003b0d4 /system/lib/libc.so (tgkill+12) [armeabi-v7a]
#1 pc 00017861 /system/lib/libc.so (pthread_kill+52) [armeabi-v7a]
#2 pc 00018477 /system/lib/libc.so (raise+10) [armeabi-v7a]
#3 pc 00014cbd /system/lib/libc.so (__libc_android_abort+36) [armeabi-v7a]
#4 pc 00013010 /system/lib/libc.so (abort+4) [armeabi-v7a]
#5 pc 0012bb6b /data/app/com.greenline.guahao-1/lib/arm/librealm-jni.so [armeabi-v7a]
#6 pc 0012bb97 /data/app/com.greenline.guahao-1/lib/arm/librealm-jni.so [armeabi-v7a]
#7 pc 0012bbef /data/app/com.greenline.guahao-1/lib/arm/librealm-jni.so [armeabi-v7a]
#8 pc 000f20f1 /data/app/com.greenline.guahao-1/lib/arm/librealm-jni.so [armeabi-v7a]
 #9 pc 000eff5d /data/app/com.greenline.guahao-1/lib/arm/librealm-jni.so [armeabi-v7a]
 #10 pc 000f0145 /data/app/com.greenline.guahao-1/lib/arm/librealm-jni.so [armeabi-v7a]
 #11 pc 000f1275 /data/app/com.greenline.guahao-1/lib/arm/librealm-jni.so [armeabi-v7a]
 #12 pc 0007fb7f /data/app/com.greenline.guahao-1/lib/arm/librealm-jni.so [armeabi-v7a]
 #13 pc 00073871 /data/app/com.greenline.guahao-1/lib/arm/librealm-jni.so [armeabi-v7a]
 #14 pc 0002fdab /data/app/com.greenline.guahao-1/lib/arm/librealm-jni.so (Java_io_realm_internal_SharedRealm_nativeCommitTransaction+22) [armeabi-v7a]
 #15 pc 000a3141 /system/lib/libart.so (art_quick_generic_jni_trampoline+32) [armeabi-v7a]
 #16 pc 74001704
 java:
 io.realm.internal.SharedRealm.b(SourceFile:262)
 io.realm.a.c(SourceFile:359)
 io.realm.z.c(SourceFile:132)
 io.realm.z.a(SourceFile:498)
 io.realm.z.b(SourceFile:423)
 io.realm.z.a(SourceFile:371)
 io.realm.RealmCache.b(SourceFile:346)
 io.realm.RealmCache.a(SourceFile:284)
 io.realm.z.o(SourceFile:281)

The situation hapenned in consumer's phone which is arm64-v8a.

Now I exclude mips x86 x86_64 and armeabi's realm-jin.so files ,include armeabi-v7a and arm64-v8a.

 packagingOptions{
        exclude "lib/mips/librealm-jni.so"
        exclude "lib/x86/librealm-jni.so"
        exclude "lib/x86_64/librealm-jni.so"
        exclude "lib/armeabi/librealm-jni.so"
    }

    splits{
        abi{
            enable true
            reset()
            include 'armeabi-v7a','arm64-v8a'
        }
    }

Building and running my app is nothing abnormal.
I checked my app in armv7 phone. There is only one armv7 realm-jni.so in Native Libraries inside APK no amrv5 realm-jni.so.
Is that correct about my operation?
On the company's only arm64-v8a android phone M2Note ,my app is in normal working order .
I am not sure is there something happened in consumer's phones.

Thanks for suggestion

@cmelchior
Copy link
Contributor

The above looks fine. I assume that solved it. If not, feel free to reopen.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants