# Android/Java

**URL:** https://forum.opencv.org/c/android-java/8.md

[Latest](https://forum.opencv.org/latest.md) · [Categories](https://forum.opencv.org/categories.md) · [Tags](https://forum.opencv.org/tags.md)

---

## [About the Android/Java category](https://forum.opencv.org/t/about-the-android-java-category/668)

<div class="topic-metadata">

**Author:** [@tim](https://forum.opencv.org/u/tim)\
**Replies:** 0

</div>

This category’s purpose is for questions and discussions about OpenCV on the Android and/or Java. Please limit discussion to OpenCV related topics, such as build errors, customization, optimization, and performance relat…

---

## [Making a desktop app using opencv in java/kotlin on Linux (Ubuntu)](https://forum.opencv.org/t/making-a-desktop-app-using-opencv-in-java-kotlin-on-linux-ubuntu/24239)

<div class="topic-metadata">

**Author:** [@Samuel\_Le](https://forum.opencv.org/u/Samuel_Le)\
**Replies:** 4\
**Last updated:** [August 3, 2026, 8:29pm UTC](https://forum.opencv.org/t/making-a-desktop-app-using-opencv-in-java-kotlin-on-linux-ubuntu/24239 "2026-08-03T20:29:27Z")

</div>

Hi, I am trying to make a desktop app in kotlin to experiment with various ideas to analyze videos. However I am unable to get opencv on my app. Things I have tried: importing opencv as a dependency by adding it to m…

---

## [Matchtemplate() with masks on CUDA CPU](https://forum.opencv.org/t/matchtemplate-with-masks-on-cuda-cpu/24237)

<div class="topic-metadata">

**Author:** [@HAL9000](https://forum.opencv.org/u/HAL9000)\
**Replies:** 1\
**Last updated:** [December 5, 2025, 7:42pm UTC](https://forum.opencv.org/t/matchtemplate-with-masks-on-cuda-cpu/24237 "2025-12-05T19:42:38Z")

</div>

Hi, Does someone know a way how I can run matchtemplate() with masks on my GPU? It works fine when using the CPU. Its just too slow. I don’t see any support for masks on CUDA and I was wondering what people actually do …

---

## [No java so (shared object) with docker build of custom modules](https://forum.opencv.org/t/no-java-so-shared-object-with-docker-build-of-custom-modules/24164)

<div class="topic-metadata">

**Author:** [@wwx](https://forum.opencv.org/u/wwx)\
**Replies:** 1\
**Last updated:** [November 3, 2025, 9:35pm UTC](https://forum.opencv.org/t/no-java-so-shared-object-with-docker-build-of-custom-modules/24164 "2025-11-03T21:35:30Z")

</div>

Attempting to add the stitcher module from contrib to opencv build for android within a docker container. Everything builds except the java#.so file. I’ve attempted to force it thru env variables (genai suggestions) to f…

---

## [Cannot access /system/vendor/lib64/libOpenCL.so when using OpenCL on Android](https://forum.opencv.org/t/cannot-access-system-vendor-lib64-libopencl-so-when-using-opencl-on-android/24160)

<div class="topic-metadata">

**Author:** [@Yixun\_Liu](https://forum.opencv.org/u/Yixun_Liu)\
**Replies:** 0\
**Last updated:** [October 28, 2025, 2:18am UTC](https://forum.opencv.org/t/cannot-access-system-vendor-lib64-libopencl-so-when-using-opencl-on-android/24160 "2025-10-28T02:18:42Z")

</div>

Hi All, I need to use OpenCL via Opencv ocl module on Android. However, when the app start I get error: library “/system/vendor/lib64/libOpenCL.so needed or dlopened by myJNI.so is not accessible for the namespace … I…

---

## [Android+Kivy+OpenCV app crashes](https://forum.opencv.org/t/android-kivy-opencv-app-crashes/24043)

<div class="topic-metadata">

**Author:** [@Sean1](https://forum.opencv.org/u/Sean1)\
**Replies:** 0\
**Last updated:** [September 23, 2025, 10:53am UTC](https://forum.opencv.org/t/android-kivy-opencv-app-crashes/24043 "2025-09-23T10:53:25Z")

</div>

I’ve also encountered this problem, and haven’t solved it yet. 2025-09-23 17:34:17.622 8344-8364 EGL\_emulation org.equipment.equipment\_manager D app\_time\_stats: avg=7007.89ms min=5037.26ms max=8978.52m…

---

## [Problem with OpenCV, Android app crashes](https://forum.opencv.org/t/problem-with-opencv-android-app-crashes/19497)

<div class="topic-metadata">

**Author:** [@Mladen](https://forum.opencv.org/u/Mladen)\
**Replies:** 1\
**Last updated:** [December 16, 2024, 12:25pm UTC](https://forum.opencv.org/t/problem-with-opencv-android-app-crashes/19497 "2024-12-16T12:25:55Z")

</div>

Hello, I would be grateful if someone provided help. I have built android app in python/kivi/kivimd and used OpenCV library. Library was correctly (I think) installed and imported into the app, and everything works wel…

---

## [How to Compile Source Code to opencv-4.11.0-android-sdk.zip](https://forum.opencv.org/t/how-to-compile-source-code-to-opencv-4-11-0-android-sdk-zip/24039)

<div class="topic-metadata">

**Author:** [@zheng\_wang](https://forum.opencv.org/u/zheng_wang)\
**Replies:** 0\
**Last updated:** [September 20, 2025, 4:29am UTC](https://forum.opencv.org/t/how-to-compile-source-code-to-opencv-4-11-0-android-sdk-zip/24039 "2025-09-20T04:29:56Z")

</div>

如何从源码编译成opencv-4.11.0-android-sdk.zip How to Compile Source Code to opencv-4.11.0-android-sdk.zip

---

## [Newbie Question](https://forum.opencv.org/t/newbie-question/23993)

<div class="topic-metadata">

**Author:** [@Teppsta](https://forum.opencv.org/u/Teppsta)\
**Replies:** 3\
**Last updated:** [September 12, 2025, 4:08pm UTC](https://forum.opencv.org/t/newbie-question/23993 "2025-09-12T16:08:52Z")

</div>

Hi I have an Android application that includes the ability to take pictures. I would like to automatically detect and blur faces if they appear in the image - and I would like to do this in my app on the device before …

---

## [Python binding prolem when cross compiling OpenCV4.10 with Android cmake and NDK toolchains on Ubuntu](https://forum.opencv.org/t/python-binding-prolem-when-cross-compiling-opencv4-10-with-android-cmake-and-ndk-toolchains-on-ubuntu/23215)

<div class="topic-metadata">

**Author:** [@oldcoder-pixel](https://forum.opencv.org/u/oldcoder-pixel)\
**Replies:** 0\
**Last updated:** [July 19, 2025, 12:00pm UTC](https://forum.opencv.org/t/python-binding-prolem-when-cross-compiling-opencv4-10-with-android-cmake-and-ndk-toolchains-on-ubuntu/23215 "2025-07-19T12:00:06Z")

</div>

Environment and Target Build environment: Ubuntu Target environment: aarch64-Linux-Android I have cross compiled Python 3.11 and it can run on Android arm-v8a. I want to cross compile OpenCV to generate a Python libr…

---

## [Opencv 4.8.0 cannot resolve symbol opencv engine interface](https://forum.opencv.org/t/opencv-4-8-0-cannot-resolve-symbol-opencv-engine-interface/14307)

<div class="topic-metadata">

**Author:** [@Dan\_Steinfeld-Cohen](https://forum.opencv.org/u/Dan_Steinfeld-Cohen)\
**Replies:** 2\
**Last updated:** [July 16, 2025, 2:01am UTC](https://forum.opencv.org/t/opencv-4-8-0-cannot-resolve-symbol-opencv-engine-interface/14307 "2025-07-16T02:01:44Z")

</div>

Hi everyone, today I tried to migrate agp from 7.4.1 to 8.1.0 but and gradle wrapper 7.5 to 8.0. When I did so openCV wouldn’t let me build my project because of errors in AsyncServiceHelper with class OpenCVEngineInter…

---

## [OpenCV with Test Automation - Resizing template images based on various screen sizes](https://forum.opencv.org/t/opencv-with-test-automation-resizing-template-images-based-on-various-screen-sizes/21032)

<div class="topic-metadata">

**Author:** [@toms\_ventril](https://forum.opencv.org/u/toms_ventril)\
**Replies:** 0\
**Last updated:** [May 16, 2025, 7:52pm UTC](https://forum.opencv.org/t/opencv-with-test-automation-resizing-template-images-based-on-various-screen-sizes/21032 "2025-05-16T19:52:20Z")

</div>

Hello! I’m looking to utilize openCV with our test automation framework, which supports both web (selenium) and android/ios (appium). My web case works fine as expected, but when I am running on android i need to resize…

---

## [OpenCV 4.11.0 issues integrating with Android](https://forum.opencv.org/t/opencv-4-11-0-issues-integrating-with-android/20823)

<div class="topic-metadata">

**Author:** [@Michelle](https://forum.opencv.org/u/Michelle)\
**Replies:** 2\
**Last updated:** [April 17, 2025, 3:33am UTC](https://forum.opencv.org/t/opencv-4-11-0-issues-integrating-with-android/20823 "2025-04-17T03:33:18Z")

</div>

I am having issue when integrating the OpenCV to the jetpack compose android studio. It shows error Execution failed for task ‘:opencv:compileDebugKotlin’. A failure occurred while executing org.jetbrains.kotlin.compi…

---

## [Opencv(4.10.0) with kotlin(2.0.0) Compilation Error](https://forum.opencv.org/t/opencv-4-10-0-with-kotlin-2-0-0-compilation-error/19686)

<div class="topic-metadata">

**Author:** [@Sahil](https://forum.opencv.org/u/Sahil)\
**Replies:** 1\
**Last updated:** [April 16, 2025, 12:30pm UTC](https://forum.opencv.org/t/opencv-4-10-0-with-kotlin-2-0-0-compilation-error/19686 "2025-04-16T12:30:15Z")

</div>

Tbh I’m new to android dev and Im facing this Issue Execution failed for task ‘:opencv:compileDebugKotlin’. A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$Gradle…

---

## [Android 15 16kb page size alignment support](https://forum.opencv.org/t/android-15-16kb-page-size-alignment-support/20418)

<div class="topic-metadata">

**Author:** [@Zoran](https://forum.opencv.org/u/Zoran)\
**Replies:** 2\
**Last updated:** [March 5, 2025, 4:02pm UTC](https://forum.opencv.org/t/android-15-16kb-page-size-alignment-support/20418 "2025-03-05T16:02:09Z")

</div>

Hi everyone, I wanted to ask the following question - is there currently a support with the OpenCV library to support the following requirement that Google added when upgrading Android applications to target the SDK 35 …

---

## [OpenCV Android module imported from SDK does not respect project's JVM settings](https://forum.opencv.org/t/opencv-android-module-imported-from-sdk-does-not-respect-projects-jvm-settings/20334)

<div class="topic-metadata">

**Author:** [@PapoPeeta22](https://forum.opencv.org/u/PapoPeeta22)\
**Replies:** 0\
**Last updated:** [February 26, 2025, 7:15am UTC](https://forum.opencv.org/t/opencv-android-module-imported-from-sdk-does-not-respect-projects-jvm-settings/20334 "2025-02-26T07:15:34Z")

</div>

Hi, I’m currently undertaking a project that involves using OpenCV and Android to make some sort of navigation app for indoors. I have managed to import the OpenCV module into my project, followed the instructions from …

---

## [Opencv\_java build imgcodecs in cmake log, but doesn't exist in jar](https://forum.opencv.org/t/opencv-java-build-imgcodecs-in-cmake-log-but-doesnt-exist-in-jar/20146)

<div class="topic-metadata">

**Author:** [@jc12345](https://forum.opencv.org/u/jc12345)\
**Replies:** 1\
**Last updated:** [February 18, 2025, 10:45pm UTC](https://forum.opencv.org/t/opencv-java-build-imgcodecs-in-cmake-log-but-doesnt-exist-in-jar/20146 "2025-02-18T22:45:12Z")

</div>

Hi all, I’m having issues building opencv\_java specifically with imgcodecs. This is building on MacOS, from source using bazel. This exact configuration works fine when i try build this on linux. i.e imgcodecs is found …

---

## [Compile openCV within AOSP source for my C++ Android application](https://forum.opencv.org/t/compile-opencv-within-aosp-source-for-my-c-android-application/19618)

<div class="topic-metadata">

**Author:** [@MUHAMMAD\_AWAIS](https://forum.opencv.org/u/MUHAMMAD_AWAIS)\
**Replies:** 4\
**Last updated:** [January 16, 2025, 10:42pm UTC](https://forum.opencv.org/t/compile-opencv-within-aosp-source-for-my-c-android-application/19618 "2025-01-16T22:42:46Z")

</div>

Hi everyone, I am struggling to find out how can I use openCV in my C++ application that is compiled in my AOSP project. I have tried downloading the source and placed it in AOSP/external/openCV and compile it with Andr…

---

## [Opencv light version?](https://forum.opencv.org/t/opencv-light-version/20142)

<div class="topic-metadata">

**Author:** [@f4ke](https://forum.opencv.org/u/f4ke)\
**Replies:** 0\
**Last updated:** [February 6, 2025, 10:07pm UTC](https://forum.opencv.org/t/opencv-light-version/20142 "2025-02-06T22:07:10Z")

</div>

I am using a python GUI framework called Kivy that also support app packaging for android. The problem is that opencv is a HUGE import on mobile, takes tons of space and the biggest chunk of app loading time (0.2s on my …

---

## [UVC video capture on Android](https://forum.opencv.org/t/uvc-video-capture-on-android/19871)

<div class="topic-metadata">

**Author:** [@zohar](https://forum.opencv.org/u/zohar)\
**Replies:** 0\
**Last updated:** [January 24, 2025, 10:05pm UTC](https://forum.opencv.org/t/uvc-video-capture-on-android/19871 "2025-01-24T22:05:00Z")

</div>

Hi Forum, I am struggling to find a current documentation and example code for capturing UVC camera video on Android platform. Any comment will be appreciated Thanks, Zohar

---

## [Failure in training LBPHFaceRecognizer on Android Studio](https://forum.opencv.org/t/failure-in-training-lbphfacerecognizer-on-android-studio/19670)

<div class="topic-metadata">

**Author:** [@Pici](https://forum.opencv.org/u/Pici)\
**Replies:** 9\
**Last updated:** [January 7, 2025, 11:56am UTC](https://forum.opencv.org/t/failure-in-training-lbphfacerecognizer-on-android-studio/19670 "2025-01-07T11:56:18Z")

</div>

I try to train my LBPHFaceRecognizer on my app written by Android studio. However, the trained LBPHFaceRecognizer can only recognize the person of the first image input. I checked all photos are read successfully. The s…

---

## [I want to reshape my blob in android from 1\*3\*62\*62 to 1\*62\*62\*3](https://forum.opencv.org/t/i-want-to-reshape-my-blob-in-android-from-1-3-62-62-to-1-62-62-3/19548)

<div class="topic-metadata">

**Author:** [@vishal2.bansal](https://forum.opencv.org/u/vishal2.bansal)\
**Replies:** 3\
**Last updated:** [December 18, 2024, 12:18pm UTC](https://forum.opencv.org/t/i-want-to-reshape-my-blob-in-android-from-1-3-62-62-to-1-62-62-3/19548 "2024-12-18T12:18:15Z")

</div>

val blob = Dnn.blobFromImage( frame, 1.0/255/0, Size(62.0, 62.0)) here blob dimension is of : 1\*3\*62\*62 i want the dimension in shape: 1\*62\*62\*3

---

## [Use kmeans to determine the prevailing colors in an image (android/java)](https://forum.opencv.org/t/use-kmeans-to-determine-the-prevailing-colors-in-an-image-android-java/19521)

<div class="topic-metadata">

**Author:** [@fuxkinghatred](https://forum.opencv.org/u/fuxkinghatred)\
**Replies:** 0\
**Last updated:** [December 14, 2024, 5:22pm UTC](https://forum.opencv.org/t/use-kmeans-to-determine-the-prevailing-colors-in-an-image-android-java/19521 "2024-12-14T17:22:26Z")

</div>

Hi! I’m trying to use kmeans to determine the prevailing colors in an image. The main idea: there is a list of URLs in the format “content://media/external/images/media/65”. I read the data from the local storage, tran…

---

## [About Virtual Background](https://forum.opencv.org/t/about-virtual-background/19489)

<div class="topic-metadata">

**Author:** [@jiangtao\_wang](https://forum.opencv.org/u/jiangtao_wang)\
**Replies:** 2\
**Last updated:** [December 12, 2024, 2:49am UTC](https://forum.opencv.org/t/about-virtual-background/19489 "2024-12-12T02:49:17Z")

</div>

I am currently using the latest 4.10 open v and I want to implement a feature. The specific details are that I need to turn on the camera, separate the portrait outline from the background, and then blend the portrait wi…

---

## [Issue related to VideoWriter in Andorid](https://forum.opencv.org/t/issue-related-to-videowriter-in-andorid/19473)

<div class="topic-metadata">

**Author:** [@strickland\_ye](https://forum.opencv.org/u/strickland_ye)\
**Replies:** 0\
**Last updated:** [December 9, 2024, 10:24am UTC](https://forum.opencv.org/t/issue-related-to-videowriter-in-andorid/19473 "2024-12-09T10:24:26Z")

</div>

Hi there. I’m newcomer to opencv. I have a face dection program it detects face from frames of a MP4 video and then using VideoWriter to export frames into a MP4 video, it works fine in Linux but not in Andorid. I hope s…

---

## [OpenCV dll hijacking](https://forum.opencv.org/t/opencv-dll-hijacking/19436)

<div class="topic-metadata">

**Author:** [@OpencvPlayer](https://forum.opencv.org/u/OpencvPlayer)\
**Replies:** 2\
**Last updated:** [December 5, 2024, 11:57am UTC](https://forum.opencv.org/t/opencv-dll-hijacking/19436 "2024-12-05T11:57:08Z")

</div>

How to avoid dll hijacking when open source opencv is used on windows?

---

## [Kotlin OpenCV4.7 Integration Error](https://forum.opencv.org/t/kotlin-opencv4-7-integration-error/12977)

<div class="topic-metadata">

**Author:** [@NanoKnyte](https://forum.opencv.org/u/NanoKnyte)\
**Replies:** 5\
**Last updated:** [November 23, 2024, 4:24pm UTC](https://forum.opencv.org/t/kotlin-opencv4-7-integration-error/12977 "2024-11-23T16:24:30Z")

</div>

Hi there, I’m new to OpenCV and I’m trying to integrate it to my new Android Project. I was able to import the SDK as a module, but when I added it as a dependency to the app module I got this error: Execution failed f…

---

## [Koala 2024.1.1 minimal build guidance](https://forum.opencv.org/t/koala-2024-1-1-minimal-build-guidance/19332)

<div class="topic-metadata">

**Author:** [@baqwas](https://forum.opencv.org/u/baqwas)\
**Replies:** 0\
**Last updated:** [November 20, 2024, 1:44am UTC](https://forum.opencv.org/t/koala-2024-1-1-minimal-build-guidance/19332 "2024-11-20T01:44:08Z")

</div>

Is there any guidance on the simple step to include OpenCV library (presumably from Maven)? The official tutorial is for an older version of the IDE. I understand the challenges in keeping the doc current at all times. …

---

## [OpenCV in Android Studio](https://forum.opencv.org/t/opencv-in-android-studio/19000)

<div class="topic-metadata">

**Author:** [@Save\_Europe](https://forum.opencv.org/u/Save_Europe)\
**Replies:** 8\
**Last updated:** [November 14, 2024, 1:00pm UTC](https://forum.opencv.org/t/opencv-in-android-studio/19000 "2024-11-14T13:00:23Z")

</div>

Hello, i can’t import OpenCV in AndroidStudio, all i get is an Exception, Build file ‘C:\\HTL\\5AHIT\\ITP-Projekt\\GesichtserkennungsApp\\build.gradle.kts’ line: 2 Plugin \[id: ‘com.android.application’, version: ‘8.1.4’, ap…

---

## [How to Import OpenCV Stitching Module into React Native Android App with C++ (New Architecture)](https://forum.opencv.org/t/how-to-import-opencv-stitching-module-into-react-native-android-app-with-c-new-architecture/19263)

<div class="topic-metadata">

**Author:** [@javadibrahimli](https://forum.opencv.org/u/javadibrahimli)\
**Replies:** 0\
**Last updated:** [November 12, 2024, 9:29am UTC](https://forum.opencv.org/t/how-to-import-opencv-stitching-module-into-react-native-android-app-with-c-new-architecture/19263 "2024-11-12T09:29:05Z")

</div>

Android/Java How to Import OpenCV Stitching Module into React Native Android App with C++ (New Architecture) Hello OpenCV team, I’m currently working on a React Native Android project and need to incorporate OpenCV’s s…

[Next page](https://forum.opencv.org/c/android-java/8.md?page=1)
