0

javacv has a sample for android "RecordActivity.java" which I tested and works perfect with Samsung devices but doesn't work with Huawei honor 6. I'm using javacv version 1.2 and latest binaries. error:

06-12 16:00:37.595 10778-11036/com.example.example E/dalvikvm: dlopen("/data/app-lib/com.example.example-1/libjniavutil.so") failed: dlopen failed: cannot locate symbol "av_version_info" referenced by "libjniavutil.so"...

I tried this https://github.com/bytedeco/javacv/issues/333 but still getting error

I'm using android studio 2.1.2 and here's my Gradle.Build:

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
lintOptions { abortOnError false }


defaultConfig {
    applicationId "com.example.example"
    minSdkVersion 15
    targetSdkVersion 18
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
packagingOptions {

    pickFirst  'META-INF/maven/org.bytedeco.javacpp-presets/opencv/pom.properties'
    pickFirst  'META-INF/maven/org.bytedeco.javacpp-presets/opencv/pom.xml'
    pickFirst  'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.properties'
    pickFirst  'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.xml'
    pickFirst  'META-INF/maven/org.bytedeco.javacpp-presets/flandmark/pom.properties'
    pickFirst  'META-INF/maven/org.bytedeco.javacpp-presets/flandmark/pom.xml'
}


dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.1.1'
compile files('libs/ffmpeg.jar')
compile files('libs/javacpp.jar')
compile files('libs/javacv.jar')

}

here is my libs folder:

enter image description here

farhang67
  • 759
  • 2
  • 14
  • 27

1 Answers1

0

After days of struggling here's what I figured out:

I had been testing on a Huawei honor 6 running android kitkat so by changing target sdk to 19 in build.gradle solved the problem but it sometimes gives the same error without changing anything and sometimes works with no error and I realized if I make a signed apk and install that it works. so I think android studio in debug mode doesn't copy files correctly.

gradle.build:

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.1.1'    
compile files('libs/ffmpeg.jar')
compile files('libs/javacpp.jar')
compile files('libs/javacv.jar')
compile files('libs/opencv.jar')

}
farhang67
  • 759
  • 2
  • 14
  • 27