thoma
thoma

Reputation: 583

Android gradle build includes jni libs twice

I've been trying to solve a problem about Android build, but couldn't figure out how to solve it. Basically, I am trying to build an Android project using Gradle. It works perfect, but the size of the final apk is 7MB more than when I builded with Eclipse.

When I unzip the apk, I see that the JNI Libs are included twice. Which is different from the Eclipse build that includes it only one time. Here is the paths I can find them in the APK:

In my project, those two files are in:

I have two different build.graddle files in:

None of them contains anything related to the JNI Libs.

To build a release, I use the command:

./gradlew assembleRelease

And everything works fine. I use Gradle 1.10.

I was wondering if someone ever encountered the problem and find a solution to avoid to the JNI Libs to be included twice in the APK.

Thanks :)

Upvotes: 1

Views: 1677

Answers (1)

TWilly
TWilly

Reputation: 4933

Put .so files in...

/src/main/jniLibs/armeabi-v7a /src/main/jniLibs/x86

directories and gradle will correctly package the .so files into the correct app and it won't include the duplicates

This is a good reference.. http://www.shaneenishry.com/blog/2014/08/17/ndk-with-android-studio/

Upvotes: 0

Related Questions