Closed chadsimtap closed 8 years ago
Try adding 'armeabi-v7a' to your include line:
splits {
abi {
enable true
reset()
include 'arm', 'arm-v7a', 'arm64', 'mips', 'x86', 'x86_64', 'armeabi-v7a'
}
}
I knew I had tried it before, but tried it again now. As I expected, I got this error: Execution failed for task ':app:installRelease'.
com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to finalize session : INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113
But while I was retesting it just now, I discovered something interesting: it fails for a release build, but passes a debug build. That doesn't really help me, since production APK size is obviously the concern, but maybe that quirk will be helpful.
What version of the Android Gradle plugin are you using?
Also, @jcarty is right. It should be something like:
include 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'mips', 'x86', 'x86_64', 'armeabi-v7a'
I'm updating our gridview example (which is using abi splits) and will update the docs accordingly
I updated the website with the correct abi names and the next release will also fix the example that uses splits.
Using new split from documentation:
splits {
abi {
enable true
reset()
include 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'mips', 'x86', 'x86_64'
}
}
Android Studio 2.1 RC Gradle version 2.12 Gradle Android plugin: 2.10-rc1
Identical results on both Nexus 6P and Nexus 5: Execution failed for task ':app:installRelease'.
com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to finalize session : INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113
Why would it work for the debug build and fail for the release build?
This sounds very weird. Do you have a sample project that replicates this issue? We're not able to reproduce it on our side.
Thanks for looking into that. I tried making a simple sample project, which worked. So a coworker and I dug into it. It's apparently related to the end of the Gradle file I posted, which renames the APK files. I hadn't written that code, so that hadn't occurred to me. Sorry about that!
So the problems were: 1) outdated APK split information (which you guys fixed in documentation) 2) my Gradle file was renaming the APK file, so the system couldn't find the right APK to load. (my fault)
Thanks for your help! Should be all set now and it looks like we'll be using Realm!
It seems the issue is fixed :tada: I am closing this now. Feel free to reopen if necessary!
Goal
APK size as small as Realm documentation says it should be
I work for a startup that is considering using Realm instead of SQLite. I am all for this--only one problem. They are concerned by the size it adds to our otherwise quite small APK. Looking at the documentation, the only solution seems to be the APK split. I tried following the APK split instructions at https://realm.io/docs/java/latest/#how-big-is-the-realm-library
It creates the APKs, but when I try to use them, I just get these errors: Skipping device 'Nexus 5 - 5.1.1' for 'app:release': Could not find build of variant which supports density 480 and an ABI in armeabi-v7a, armeabi Skipping device 'Nexus 6P - 6.0.1' for 'app:release': Could not find build of variant which supports density 560 and an ABI in arm64-v8a, armeabi-v7a, armeabi
These are the only testing devices I have available at the moment. When I don't do an APK split, the app (with Realm) works--so I know the needed code is there. But apparently Realm isn't ready to do an APK split for the processor architecture on those two very popular devices? Or maybe I'm somehow doing something wrong?
I posted this question on StackOverflow four days ago: http://stackoverflow.com/questions/36705330/cant-reduce-size-realm-adds-to-app?noredirect=1#comment61178933_36705330
Since there's been no answer there, I thought I would try here. I would also accept an alternative to the APK split if there's some way to get the APK size (both for downloading and post installation) down substantially.
Expected Results
Small, fully functional APKs.
Actual Results
APKs that cannot be installed on a Nexus 5 or Nexus 6P
Steps & Code to Reproduce
Do the APK split as described in the documentation. Try to use on a Nexus 5 or Nexus 6P.
Code Sample
Version of Realm and tooling
Realm version(s): 89.0
Android Studio version: Android Studio 2.1 Beta 2
Which Android version and device: Nexus 6P (Marshmallow) and Nexus 5 (Lollipop)