# Problem with OpenCV, Android app crashes

**URL:** <https://forum.opencv.org/t/problem-with-opencv-android-app-crashes/19497>\
**Category:** Android/Java\
**Tags:** programming, kivy\
**Created:** [December 11, 2024, 11:40pm UTC](https://forum.opencv.org/t/problem-with-opencv-android-app-crashes/19497 "2024-12-11T23:40:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mladen](https://avatars.discourse-cdn.com/v4/letter/m/e36b37/32.png) [@Mladen](https://forum.opencv.org/u/Mladen)\
**Post date:** [December 11, 2024, 11:40pm UTC](https://forum.opencv.org/t/problem-with-opencv-android-app-crashes/19497/1 "2024-12-11T23:40: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 well on my desktop.

However, when I compile APK and install the app on the phone, app crashes. Logcat records the following issue:

```auto
12-12 00:16:56.217 1047 1091 I python : Traceback (most recent call last):
12-12 00:16:56.217 1047 1091 I python : File "/content/.buildozer/android/app/main.py", line 54, in <module>
12-12 00:16:56.218 1047 1091 I python : File "/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/kivinova/arm64-v8a/cv2/ __init__.py", line 181, in <module>
12-12 00:16:56.219 1047 1091 I python : File "/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/kivinova/arm64-v8a/cv2/ __init__.py", line 111, in bootstrap
12-12 00:16:56.220 1047 1091 I python : File "/content/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/kivinova/arm64-v8a/cv2/ __init__.py", line 109, in load_first_config
12-12 00:16:56.221 1047 1091 I python : ImportError: OpenCV loader: missing configuration file: ['config.py']. Check OpenCV installation.
12-12 00:16:56.221 1047 1091 I python : Python for android ended.

```

In line 54 of main.py I am importing cv2.

During the development, I was using:

```auto
opencv-contrib-python 4.10.0.84
opencv-python 4.10.0.84
opencv-python-headless 4.10.0.84

```

this is my requirements line in buildozer.spec

```auto
requirements = python3,kivy,kivymd,kivy_garden.graph,kivymd_extensions,kivymd-extensions.akivymd,kivy_garden.mapview,plyer,requests,chardet,beautifulsoup4,python-dateutil,pycryptodome,barcode,pillow,numpy,opencv-python, opencv-contrib-python, opencv-python-headless,qrcode,dbr

```

I am using python 3.9.7

Can someone suggest how I can solve this problem?

Regards and many thanks!

---

<div class="post-metadata">

**Author:** ![Mladen](https://avatars.discourse-cdn.com/v4/letter/m/e36b37/32.png) [@Mladen](https://forum.opencv.org/u/Mladen)\
**Post date:** [December 16, 2024, 12:25pm UTC](https://forum.opencv.org/t/problem-with-opencv-android-app-crashes/19497/2 "2024-12-16T12:25:55Z")

</div>

Update:

[![](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/a/a31ce271ca096329f597676996c35abaf898694f.jpeg "Deploying Kivy App With Buildozer Using OpenCV-python - The Buildozer.Spec Configuration") ](https://www.youtube.com/watch?v=Gnm81qMWfs8&t=221s)

This video tutorial enabled me to avoid the error when testing my android app.  
It seems that the problem had been fixed.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [September 23, 2025, 1:23pm UTC](https://forum.opencv.org/t/problem-with-opencv-android-app-crashes/19497/3 "2025-09-23T13:23:42Z")

</div>

A post was split to a new topic: [Android+Kivy+OpenCV app crashes](https://forum.opencv.org/t/android-kivy-opencv-app-crashes/24043)
