JavaCV + Android Studio + gradle- possible?

前端 未结 7 1364
难免孤独
难免孤独 2021-01-31 21:19

I\'m trying use JavaCV with Android Studio and Gradle. I wrote such code fragment:

   repositories {
    mavenCentral()
    maven {
        url \"http://maven2.j         


        
7条回答
  •  情书的邮戳
    2021-01-31 21:47

    If you try out with javacv 1.2, we have to do some additional steps so at to get this working. Here is my build.gradle file

    android {
        compileSdkVersion 24
        buildToolsVersion "24.0.2"
    
        defaultConfig {
            applicationId "org.audiorecording"
            minSdkVersion 15
            targetSdkVersion 24
            versionCode 1
            versionName "1.0"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
        packagingOptions {
            exclude 'META-INF/LICENSE.txt'
            exclude 'META-INF/NOTICE.txt'
            exclude 'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.properties'
            exclude 'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.xml'
    
            //might need these if you use openCV
            exclude 'META-INF/maven/org.bytedeco.javacpp-presets/opencv/pom.properties'
            exclude 'META-INF/maven/org.bytedeco.javacpp-presets/opencv/pom.xml'
        }
    }
    
    repositories {
        mavenCentral()
    }
    
    configurations {
        all*.exclude group: 'org.bytedeco', module: 'javacpp-presets'
    }
    
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        testCompile 'junit:junit:4.12'
        compile 'com.android.support:appcompat-v7:24.2.1'
        compile 'com.android.support:design:24.2.1'
        compile 'org.bytedeco:javacv:1.2'
        compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.1.0-1.2', classifier: 'android-arm'
        compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '3.0.2-1.2', classifier: 'android-arm'
    
    }
    

提交回复
热议问题