Realm-java: Remove (or make optional) MIPS native library

Created on 27 Sep 2016  Â·  8Comments  Â·  Source: realm/realm-java

Goal

As armeabi is not supported anymore in Realm 2.0, maybe it is also time to drop mips support?
I made some research, and as I found, there is really lack of MIPS devices: https://www.reddit.com/r/Android/comments/4ofdkv/state_of_mips_plus_some_statistics/ <- this is the best source I have found.
In my opinion it's a waste of apk size. Or maybe there is a way to make it optional, without apk split?

Expected Results

Smaller APK.

BTW: Thanks for this amazing database!

T-Help

Most helpful comment

@PiotrWpl Also, it is actually quite easy for you to exclude the mips lib:

See https://realm.io/docs/java/latest/#couldnt-load-librealm-jniso

something like:

android {
    //...
    packagingOptions {
        exclude "lib/mips/librealm-jni.so"
    }
    //...
}

All 8 comments

You are right that generally there isn't any MIPS mobile devices around, but it is somewhat used on other devices running Android like TV's and such, and we don't want to exclude them from the party :)

We removed armeabi because Google also dropped support for it and the only devices left using it are practically ancient.

Note you can always do an APK split to remove MIPS if you want to in your particular context: https://realm.io/docs/java/latest/#how-big-is-the-realm-base-library

Hi @cmelchior,

thx for response.

but it is somewhat used on other devices running Android like TV's and such, and we don't want to exclude them from the party :)

I understand, but maybe this is a small percent of Realm use case?

Note you can always do an APK split to remove MIPS if you want to in your particular context:
I know about APK split, but after couple of tests on production, we realize that is harder to maintain multiple APK. And what worse, we had some crashes because of that.

Maybe there is a way, to make MIPS support optional on library level? I don't know much about native libraries on Android, but I thought about something like:

classpath "io.realm:realm-gradle-plugin:2.0-0" classpath "io.realm:realm-gradle-abi-mips:2.0.0"

In this case, when I skip "io.realm:realm-gradle-abi-mips", I will not get mips support. Of course, this solution can be also applied to others ABI in the future.

Is it technically possible?

@PiotrWpl Also, it is actually quite easy for you to exclude the mips lib:

See https://realm.io/docs/java/latest/#couldnt-load-librealm-jniso

something like:

android {
    //...
    packagingOptions {
        exclude "lib/mips/librealm-jni.so"
    }
    //...
}

@beeender
wow, really? :) Why I didn't find it before now. This is exactly what i wanted.

Thx @cmelchior & @beeender for a help!

also you can exclude some others if you don't care about the slight difference on the performance (eg. keep x86 but remove x86_64)

I might make mistake on the directory name, you can always check the right lib name in the build folder.

mips (and mips64) has been deprecated in NDK r16 and will be removed in r17. https://developer.android.com/ndk/guides/abis.html
Maybe now is the time to remove the mips library?

I hope so? Does anyone think this would be a breaking change? Be honest, i have never seen a real mips Android device in my whole life ....

Removal of mips is on the breaking change wishlist for 5.0 https://github.com/realm/realm-java/issues/5372

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yuwu picture yuwu  Â·  3Comments

Merlin1993 picture Merlin1993  Â·  3Comments

wyvern610 picture wyvern610  Â·  3Comments

pawlo2102 picture pawlo2102  Â·  3Comments

jjorian picture jjorian  Â·  3Comments