Upgraded from 3.4.9 to 4.2.0 and can no longer see camera view [Android]

asked 2020-02-25 05:44:17 -0500

Jonaskri gravatar image

updated 2020-02-25 07:25:11 -0500

Im using android studio with Java to create a mobile application with OpenCV 4.2.0. Because of feature requirements i decided to update to 4.2.0. After updating to the newest version, i can no longer see camera output in my application (Completely black).

Main activity code: (unchanged since updating to 4.2.0) https://pastebin.com/sLmS1pXm

I set the application to print a log in onCameraViewStarted, but the log is never visible, and so the onCameraViewStarted method is never called. I tried the same in onCameraFrame, but get the same result.

The only error i get is: E/OpenCV/StaticHelper: OpenCV error: Cannot load info library for OpenCV

But from what i've read this error is irrelevant.

Any help would be greatly appreciated!

EDIT: Changed main activity to something more simplified: https://pastebin.com/pmRFS6ti Same problem with view being black though. onCameraViewStarted, onCameraViewStopped and onCameraFrame are never called. OpenCV initializes successfully and the activity lifecycle methods run as usual (onCreate, onStart, onResume), but not any of the onPause or onDestroy methods as expected.

EDIT: Some extra information that might be of interest. Android API: 28, emulated phone: Nexus One. I have copied sdk/native/libs contents to application main directory in folder named jniLibs.

edit retag flag offensive close merge delete