Scene: Android Studio compiled my project (the project has the use of JNI), compile no error, normal installation to my machine, but the operation of the error, did not find the *.so file ...
But clearly in the Libs, the directory has the relevant documents?
Refer to the online majority of practices, the new jnilibs folder to put the relevant files in this file, for example
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/59/0B/wKioL1TF8WujaUuqAACNyDhGgmg024.jpg "title=" 1.png " alt= "Wkiol1tf8wujauuqaacnydhggmg024.jpg"/>
This is the default condition for the directory structure
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/59/0B/wKioL1TF8ibTTgKMAAB1PV0V6FY200.jpg "title=" 2.png " alt= "Wkiol1tf8ibttgkmaab1pv0v6fy200.jpg"/>
So it's done.
But my project is the directory structure from Eclipse is not the same as above, as follows:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/59/0E/wKiom1TF85SB1AwYAADd1OQo8ZE424.jpg "title=" 3.png " alt= "Wkiom1tf85sb1awyaadd1oqo8ze424.jpg"/>
I also joined the jnilibs this directory, package related files to put here, the structure to run to the machine or not, or can not find the *.so file ...
Directory structure I do not want to change, and then I look at the Build.gradle file has sourcesets this setting, the attempt to add parameters here, sure enough to run the normal 650) this.width=650; "src="/http Img.baidu.com/hi/jx2/j_0005.gif "alt=" J_0005.gif "/>
Code:
sourceSets { main { manifest.srcFile ' Androidmanifest.xml ' java.srcdirs = [' src '] resources.srcdirs = [' src '] aidl.srcdirs = [' src '] renderscript.srcdirs = [' src '] res.srcdirs = [' Res '] assets.srcdirs = [' Assets '] // The key is this sentence jnilibs.srcdirs = [' Jnilibs '] } debug.setroot (' Build-types/debug ') release.setroot (' build-types/release ') }
This article from "yards Nong to turn over" blog, please be sure to keep this source http://xiaodongdong.blog.51cto.com/7049299/1608495
Add. So files in Android studio