zynkware / Document-Scanning-Android-SDK

Document Scanner is an Android library (kotlin based) for scanning documents based on CameraX API and a tiny version of OpenCV.
173 stars 65 forks source link

getting error after starting AppScanActivity #15

Open Venkata-Bhagavan opened 1 year ago

Venkata-Bhagavan commented 1 year ago

I'm getting this error and the activity closes soon after a few milliseconds.

2023-08-11 13:54:03.081 15946-15946 nky.docscantes          app.mr.venky.docscantest             E  No implementation found for long org.opencv.core.Mat.n_Mat() (tried Java_org_opencv_core_Mat_n_1Mat and Java_org_opencv_core_Mat_n_1Mat__)
2023-08-11 13:54:03.081 15946-15946 AndroidRuntime          app.mr.venky.docscantest             D  Shutting down VM
2023-08-11 13:54:03.083 15946-15946 AndroidRuntime          app.mr.venky.docscantest             E  FATAL EXCEPTION: main
                                                                                                    Process: app.mr.venky.docscantest, PID: 15946
                                                                                                    java.lang.UnsatisfiedLinkError: No implementation found for long org.opencv.core.Mat.n_Mat() (tried Java_org_opencv_core_Mat_n_1Mat and Java_org_opencv_core_Mat_n_1Mat__)
                                                                                                        at org.opencv.core.Mat.n_Mat(Native Method)
                                                                                                        at org.opencv.core.Mat.<init>(Mat.java:23)
                                                                                                        at com.zynksoftware.documentscanner.common.extensions.ImageProxyExtensionsKt.yuvToRgba(ImageProxyExtensions.kt:29)
                                                                                                        at com.zynksoftware.documentscanner.ui.components.scansurface.ScanSurfaceView.setUseCases$lambda-3(ScanSurfaceView.kt:158)
                                                                                                        at com.zynksoftware.documentscanner.ui.components.scansurface.ScanSurfaceView.$r8$lambda$b7NjaRB3uMqIPgduH9qkv_i8afg(Unknown Source:0)
                                                                                                        at com.zynksoftware.documentscanner.ui.components.scansurface.ScanSurfaceView$$ExternalSyntheticLambda2.analyze(Unknown Source:2)
                                                                                                        at androidx.camera.core.ImageAnalysis.lambda$setAnalyzer$2(ImageAnalysis.java:481)
                                                                                                        at androidx.camera.core.ImageAnalysis$$ExternalSyntheticLambda2.analyze(Unknown Source:2)
                                                                                                        at androidx.camera.core.ImageAnalysisAbstractAnalyzer.lambda$analyzeImage$0$androidx-camera-core-ImageAnalysisAbstractAnalyzer(ImageAnalysisAbstractAnalyzer.java:286)
                                                                                                        at androidx.camera.core.ImageAnalysisAbstractAnalyzer$$ExternalSyntheticLambda1.run(Unknown Source:14)
                                                                                                        at android.os.Handler.handleCallback(Handler.java:938)
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                                        at android.os.Looper.loop(Looper.java:255)
                                                                                                        at android.app.ActivityThread.main(ActivityThread.java:8212)
                                                                                                        at java.lang.reflect.Method.invoke(Native Method)
                                                                                                        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:632)
                                                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1049)
kiranNanda commented 1 year ago

Have you found any solution for it.Please share I am also stuck.

Venkata-Bhagavan commented 1 year ago

Nope.

rafaqat-funprime commented 1 year ago

Make sure have you set these configuration at the startup:

val configuration = DocumentScanner.Configuration() configuration.imageQuality = 100 configuration.imageSize = 1000000 // 1 MB configuration.imageType = Bitmap.CompressFormat.JPEG DocumentScanner.init(this, configuration) // or simply DocumentScanner.init(this)

kiranNanda commented 1 year ago

Yes I have set it. In your created project its working but when I import library to my project then it's creating issue.

MatejStrlek commented 4 months ago

Same problem here, same error is thrown, maybe you found fix meanwhile? @iulian-buzila