diff --git a/JavaCV-android-example/app/build.gradle b/JavaCV-android-example/app/build.gradle index 5c42b7e..afe8130 100644 --- a/JavaCV-android-example/app/build.gradle +++ b/JavaCV-android-example/app/build.gradle @@ -14,29 +14,28 @@ android { dexOptions { javaMaxHeapSize "2G" } - packagingOptions { - exclude 'META-INF/native-image/**' - } } -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.3.0' - implementation group: 'org.bytedeco', name: 'javacv', version: '1.5.5' +configurations { + javacpp +} - implementation group: 'org.bytedeco', name: 'openblas', version: '0.3.13-1.5.5', classifier: 'android-arm' - implementation group: 'org.bytedeco', name: 'openblas', version: '0.3.13-1.5.5', classifier: 'android-arm64' - implementation group: 'org.bytedeco', name: 'openblas', version: '0.3.13-1.5.5', classifier: 'android-x86_64' - implementation group: 'org.bytedeco', name: 'openblas', version: '0.3.13-1.5.5', classifier: 'android-x86' +task javacppExtract(type: Copy) { + dependsOn configurations.javacpp - implementation group: 'org.bytedeco', name: 'opencv', version: '4.5.1-1.5.5', classifier: 'android-arm' - implementation group: 'org.bytedeco', name: 'opencv', version: '4.5.1-1.5.5', classifier: 'android-arm64' - implementation group: 'org.bytedeco', name: 'opencv', version: '4.5.1-1.5.5', classifier: 'android-x86_64' - implementation group: 'org.bytedeco', name: 'opencv', version: '4.5.1-1.5.5', classifier: 'android-x86' + from { configurations.javacpp.collect { zipTree(it) } } + include "lib/**" + into "$buildDir/javacpp/" + android.sourceSets.main.jniLibs.srcDirs += ["$buildDir/javacpp/lib/"] - implementation group: 'org.bytedeco', name: 'ffmpeg', version: '4.3.2-1.5.5', classifier: 'android-arm' - implementation group: 'org.bytedeco', name: 'ffmpeg', version: '4.3.2-1.5.5', classifier: 'android-arm64' - implementation group: 'org.bytedeco', name: 'ffmpeg', version: '4.3.2-1.5.5', classifier: 'android-x86_64' - implementation group: 'org.bytedeco', name: 'ffmpeg', version: '4.3.2-1.5.5', classifier: 'android-x86' + tasks.getByName('preBuild').dependsOn javacppExtract +} +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation 'androidx.appcompat:appcompat:1.3.0' + implementation group: 'org.bytedeco', name: 'javacv', version: '1.5.6' + javacpp group: 'org.bytedeco', name: 'openblas-platform', version: '0.3.17-1.5.6' + javacpp group: 'org.bytedeco', name: 'opencv-platform', version: '4.5.3-1.5.6' + javacpp group: 'org.bytedeco', name: 'ffmpeg-platform', version: '4.4-1.5.6' }