本机文件无法加载

时间:2015-12-12 05:24:12

标签: java opencv android-studio java-native-interface opencv4android

我正在尝试运行此处找到的车道检测代码:JSK (JPEG Scan Killer)

我在三星Galaxy选项卡上运行此应用程序,应用程序显示我设置霍夫值的初始屏幕,但是当我继续时,它会崩溃。 logcat显示以下内容:

apply plugin: 'com.android.application'
buildscript {
repositories {
    mavenCentral()
}
dependencies {
    classpath 'com.android.tools.build:gradle:1.5.0'
}
}
allprojects{
repositories {
    mavenCentral()
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project('openCVLibrary2411')
}

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

sourceSets {
    main {
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src']
        resources.srcDirs = ['src']
        aidl.srcDirs = ['src']
        renderscript.srcDirs = ['src']
        res.srcDirs = ['res']
        assets.srcDirs = ['assets']
    }

    // Move the tests to tests/java, tests/res, etc...
    instrumentTest.setRoot('tests')

    // Move the build types to build-types/<type>
    // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
    // This moves them out of them default location under src/<type>/... which would
    // conflict with src/ being used by the main source set.
    // Adding new build types or product flavors should be accompanied
    // by a similar customization.
    debug.setRoot('build-types/debug/java')
    release.setRoot('build-types/release')
}
}

供参考,这是build.gradle。我根据其他类似帖子的建议稍微更新了一下:

PhotoDetailViewController

1 个答案:

答案 0 :(得分:0)

我在sourceSets部分的build.gradle中使用以下内容解决了这个问题:

jniLibs.srcDirs = ['libs']