java - Issue with multiple .so files in android -
i have developed application in android studio. have integrated ffmpeg library in application. library contains module , *.so
files. need integrate library having jar file , native *.so
files, twilio calling.
the issue facing is, whenever try build application, *.so
file of twilio
library automatically gets deleted. app gives error that, can not find native file.
here build.gradle
import org.apache.tools.ant.taskdefs.condition.os apply plugin: 'com.android.application' repositories { jcenter() } android { compilesdkversion 23 buildtoolsversion "23.0.2" defaultconfig { applicationid "my.package.name" minsdkversion 15 targetsdkversion 23 versioncode 1 versionname "1.0" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } packagingoptions { exclude 'meta-inf/license.txt' exclude 'meta-inf/notice.txt' exclude 'meta-inf/license' exclude 'meta-inf/notice' pickfirst 'meta-inf/asl2.0' } sourcesets.main { jnilibs.srcdir 'src/main/libs' //set .so files location libs jni.srcdirs = [] //disable automatic ndk-build call } // call regular ndk-build(.cmd) script app directory task ndkbuild(type: exec) { if (os.isfamily(os.family_windows)) { commandline 'ndk-build.cmd', '-c', file('src/main').absolutepath } else { def ndkdir = android.ndkdirectory.getabsolutepath() commandline ndkdir + '/ndk-build', '-c', file('src/main').absolutepath } } tasks.withtype(javacompile) { compiletask -> compiletask.dependson ndkbuild } } task nativelibstojar(type: jar, description: 'create jar archive of native libs') { destinationdir file("$builddir/native-libs") basename 'native-libs' filetree(dir: 'libs', include: '**/*.so') 'lib/' } tasks.withtype(javacompile) { compiletask -> compiletask.dependson(nativelibstojar) } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) testcompile 'junit:junit:4.12' compile project(':ffmpeglibs') compile files('libs/commons-codec-1.9.jar') compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:design:23.1.1' compile 'com.android.support:support-v4:23.1.1' compile 'com.android.support:percent:23.1.1' compile 'com.android.support:palette-v7:23.1.1' compile 'com.fasterxml.jackson.core:jackson-core:2.7.0-rc1' compile 'com.fasterxml.jackson.core:jackson-annotations:2.7.0-rc1' compile 'com.fasterxml.jackson.core:jackson-databind:2.7.0-rc1' compile 'com.google.android.gms:play-services-gcm:8.4.0' compile 'com.google.code.gson:gson:2.5' compile 'com.android.support:recyclerview-v7:23.1.1' compile 'com.daimajia.swipelayout:library:1.2.0' compile 'com.nineoldandroids:library:2.4.0' compile 'com.github.bumptech.glide:glide:3.6.1' compile 'com.timehop.stickyheadersrecyclerview:library:0.4.3' compile files('libs/twilioclient-android.jar') }
Comments
Post a Comment