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

Remove (or make optional) MIPS native library #3504

Closed
PiotrWpl opened this issue Sep 27, 2016 · 8 comments
Closed

Remove (or make optional) MIPS native library #3504

PiotrWpl opened this issue Sep 27, 2016 · 8 comments
Labels

Comments

@PiotrWpl
Copy link

PiotrWpl commented Sep 27, 2016

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!

@cmelchior
Copy link
Contributor

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

@PiotrWpl
Copy link
Author

PiotrWpl commented Sep 28, 2016

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?

@beeender
Copy link
Contributor

@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"
    }
    //...
}

@PiotrWpl
Copy link
Author

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

Thx @cmelchior & @beeender for a help!

@beeender
Copy link
Contributor

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.

@ElegyD
Copy link

ElegyD commented Nov 21, 2017

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?

@beeender
Copy link
Contributor

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 ....

@Zhuinden
Copy link
Contributor

Removal of mips is on the breaking change wishlist for 5.0 #5372

@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

6 participants