2

如何在我的 Android Studio 项目中导入 BoofCV?我已经看过这里了。我完全糊涂了。请为我提供分步指南。我感谢您的帮助。

4

3 回答 3

4

将下面的行添加到 app/build.gradle 应该可以解决问题

compile group: 'org.boofcv', name: 'android', version: '0.23'

将 0.23 替换为当前版本。

更新在更新的版本中,您需要执行以下操作:

api group: 'org.boofcv', name: 'boofcv-android', version: '0.30'
于 2016-05-03T15:37:58.067 回答
0

在 Android Studio 中集成 BoofCV 时,我遇到了一些问题。我在这里发布这些及其解决方案,以便对其他人有用。

BoofCV Android 支持集成文档链接 https://boofcv.org/index.php?title=Android_support

在 Android Studio 中添加 BoofCV

如果您打算只使用一个模块,您可以将以下代码添加到 app/build.gradle

dependencies {
    api group: 'org.boofcv', name: 'boofcv-android', version: '0.34'
}

如果您要使用多个模块,可以将以下代码添加到 app/build.gradle

dependencies {
    ['boofcv-android', 'boofcv-core'].each { String a -> api group: 'org.boofcv', name: a, version: '0.34' }
}

与 Android 依赖项冲突

如果您遇到冲突错误,您需要在 app/build.gradle 中添加以下内容

configurations {
    all*.exclude group: "xmlpull", module: "xmlpull"
    all*.exclude group: "org.apache.commons", module: "commons-compress"
    all*.exclude group: "com.thoughtworks.xstream", module: "commons-compress"
}

验证 Dex 错误失败

如果您无法验证 dex 文件错误方法句柄类型 7,那么您需要在 app/build.gradle 中添加以下内容

android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}
于 2019-09-12T06:52:51.943 回答
0

对于尝试过此操作但仍无法使用 Boofcv 的任何人。

重要的是还要添加

dependencies {
     api group: 'org.boofcv', name: 'boofcv-core', version: '0.31'
}

我知道这听起来有点明显,但我没有找到任何说我明确需要这样做的东西。祝你好运!

于 2020-02-24T23:24:38.623 回答