i am new to android studio and wants to include boofcv library in my project. I am using Android studio for development. I have done the following steps in order to include the library and is stuck with build.gradle configuration.
Step 1: Have downloaded per-compiled jar files from http://boofcv.org/index.php?title=Download:BoofCV
Step 2: Have updated settings.gradle as
include ':app'
include ':libs:boofcv-libs'
Step 3: My build.gradle looks like:
apply plugin: 'com.android.application'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
}
}
allprojects {
repositories {
jcenter()
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
As the note of your project's build.gradle
file will suggest:
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Remove the compile statements in that gradle file:
compile project(":libs:boofcv-libs")
And copy them to other (module's) build.gradle
and make dependencies look like this:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:20.+'
compile project(":libs:boofcv-libs")
}
BoofCV is on maven central so you could just do the following too:
['calibration','feature','geo','ip','recognition','sfm','android'].each
{ String a -> compile group: 'org.boofcv', name: a, version: '0.18' }
In the next it will be even easier if you just want everything:
compile group: 'org.boofcv', name: "all", version: '0.19-SNAPSHOT'
so it will be something like this:
compile "org.boofcv:boofcv-android:0.27"
as mentioned in this page , to avoid library conflict add this to app.gradle:
// Remove libraries that conflict with libraries already included with Android
configurations {
all*.exclude group: "xmlpull", module: "xmlpull"
all*.exclude group: "org.apache.commons", module: "commons-compress"
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.