JavaCV + Android Studio + gradle- possible?

前端 未结 7 1102
难免孤独
难免孤独 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:53

    1.WARNING: That's not enough!:

      dependencies { compile group: 'org.bytedeco', name: 'javacv', version: '0.9'}
    

    2.EDIT: Sorry for mistake, my recent solution which I posted here and which told only about line above was wrong. But I checked it out and this works for me:

    a)Add dependencies

    dependencies {
        compile group: 'org.bytedeco', name: 'javacv', version: '0.9'
        compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '2.4.9-0.9', classifier:    'android-arm'
        compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '2.3-0.9', classifier: 'android-arm'    
    }
    

    b) Create jniLibs dir inside your project (on the same level as normal libs dir. EDIT: If you have some troubles try moving jniLibs to app/src/main).
    c) Add required .so files extracted from opencv-android-arm.jar and ffmpeg-android-arm.jar (or only this files which you really need) to created jniLibs dir. (If you don't know about what I'm talking you can download javacv-0.9-bin.zip from JavaCV page and inside it you can find these 2 .jars).

提交回复
热议问题