Android NDK - multlib support using gradle -


my question directed towards native android development 64bit android systems.

i looking way configure support of 32bit compiled native libraries @ 64bit android system using gradle build system. libraries application should use available 32bit build. time consuming , error prone port these libraries 64bit.

hence, want configure gradle deploy these prebuilt 32bit binaries , use 32bit version of android application well.

the current configuration leads following error:

 e/androidruntime﹕ fatal exception: main     process: <application_name>, pid: 2170     java.lang.unsatisfiedlinkerror:  dalvik.system.pathclassloader [dexpathlist[[zip file "/data/app/<application_name>/base.apk"], nativelibrarydirectories=[/vendor/lib64, /system/lib64]]]  enter code here`couldn't find "libmynativelibrary.so"     @ java.lang.runtime.loadlibrary(runtime.java:366) 

it seems though pathclassloader looks in wrong directories. checked provided apk file , lacking libraries. there no lib folder inside apk. build system not seam include 32bit libraries. since there 1 prebuild version armv7 these libraries in app/src/main/jnilibs folder.

i have add setup works 32bit android system. tried emulator , physical device before.

how should 1 activate multiarch 32/64bit support using gradle? or how possible deploy 32bit application 64bit android system using android studio/gradle?

i searched web , found 1 link concerning topic, referring older build system: https://source.android.com/source/64-bit-builds.html. not know how adopt description gradle.

i using android studio (build: 141.1989493, june 6, 2015). project/build.gradle untouched. app/build.gradle file looks this:

apply plugin: 'com.android.application'  android {     compilesdkversion 22     buildtoolsversion "22.0.1"      defaultconfig {         applicationid "<application_name>"         minsdkversion 1         targetsdkversion 22         versioncode 1         versionname "1.0"     }     buildtypes {         release {             minifyenabled false             proguardfiles getdefaultproguardfile('proguard-android.txt'),                                                  'proguard-rules.pro'         }         debug {             debuggable true         }     }      productflavors {         armv7 {             ndk {                 abifilter "armeabi-v7a"             }         }         fat     } }  dependencies {     compile filetree(dir: 'libs', include: ['*.jar']) } 

the concept of mulilib projects part of android system build , shouldn't set android:multiarch option have 32bit libs since option apps providing both 32 , 64bit libraries other installed application.

64-bit android systems support 32-bit applications directly. need package app, .so files inside lib/(armeabi-v7a,x86,...) of apk, android devices.

at install time, libs of architecture preferred device installed. ie: if there no x86_64 folder, x86 libs installed / if there no arm64-v8a folder, armeabi-v7a libs installed, , app run in 32-bit mode.

if don't have under lib, means android studio doesn't know .so files. default them inside jnilibs/(armeabi-v7a,x86,...), hence should place them there or change sourcesets.main.jnilibs.srcdir directory of choice.


Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -