garg-lucifer / AndroidDocumentFilter

Android Document Filter is an Android Library built on top of OpenCV that provides various filters for document scanning.
https://www.linkedin.com/in/naman-garg-1b67371a1/
Apache License 2.0
30 stars 6 forks source link

App Crashes on DocumentFilter.getMagicFilter(bitmap) #2

Open Melhosh opened 2 years ago

Melhosh commented 2 years ago

Hello, App crashes on DocumentFilter.getMagicFilter(bitmap) and DocumentFilter.getShadowRemoval(bitmap) filters. Below the Crash log:

E/pdf.scanner.ap: No implementation found for long org.opencv.imgproc.Imgproc.createCLAHE_2() (tried Java_org_opencv_imgproc_Imgproc_createCLAHE_12 and Java_org_opencv_imgproc_Imgproc_createCLAHE_12__)
E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
    Process: com.pdf.scanner.app, PID: 760
    java.lang.UnsatisfiedLinkError: No implementation found for long org.opencv.imgproc.Imgproc.createCLAHE_2() (tried Java_org_opencv_imgproc_Imgproc_createCLAHE_12 and Java_org_opencv_imgproc_Imgproc_createCLAHE_12__)
        at org.opencv.imgproc.Imgproc.createCLAHE_2(Native Method)
        at org.opencv.imgproc.Imgproc.createCLAHE(Imgproc.java:806)
Melhosh commented 2 years ago

Hello @garg-lucifer Have you got a chance to check the above issue?

garg-lucifer commented 2 years ago

Hey, can you help me reproduce that error? Is it giving errors for every single image or some specific images? Can you send me some images for which it is failing so that I can reproduce that?

Melhosh commented 2 years ago

It is happening for every single image. Android 11 Samsung Note 10

garg-lucifer commented 2 years ago

I'm sorry but currently, I don't know what's the issue. It's running fine on my Android & I can't reproduce the error either.

MuSHaKS commented 2 years ago

i have the same errors. -_-

garg-lucifer commented 2 years ago

Hey, @MuSHaKS if possible can you share your project's build.gradle file for app and module level?

MuSHaKS commented 2 years ago

Hey @garg-lucifer , Please find the below app build.gradle:

plugins { id 'com.android.application' }

android { compileSdk 31

defaultConfig {
    applicationId "com.altawfeerhyper.archivesystem"
    minSdk 21
    targetSdk 31
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {
    viewBinding true
    dataBinding true
}

}

dependencies {

implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
implementation 'androidx.preference:preference:1.1.1' // for preference layouts
implementation 'androidx.exifinterface:exifinterface:1.3.3' // for check rotate device
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

// Image document filter
implementation 'com.github.garg-lucifer:AndroidDocumentFilter:0.7.0'
// for document scanner
implementation project(path: ':documentscanner')
implementation project(':openCVLibrary')

//ZXing  Barcode scanner
implementation 'com.journeyapps:zxing-android-embedded:3.3.0'
// image zooming
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
// for edit text layout preferencex
implementation 'com.takisoft.preferencex:preferencex:1.1.0'

def room_version = "2.4.0"
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"

def lifecycle_version = "2.4.0"
implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version" 
implementation "androidx.lifecycle:lifecycle-livedata:$lifecycle_version"

//Volley
implementation 'com.android.volley:volley:1.2.1'
//Toast
implementation 'com.github.GrenderG:Toasty:1.5.0'
//Gson
implementation 'com.google.code.gson:gson:2.8.6'

}

garg-lucifer commented 2 years ago

Hey @MuSHaKS I have created another project LibraryTesting in which I tried to replicate your project by adding all the dependencies you've used except implementation project(path: ':documentscanner') implementation project(':openCVLibrary') these two because my library already uses OpenCVLibrary and it's working fine currently on every filter. It would be great if you can fork LibraryTesting and if you can reproduce that error on your end so I can at least replicate that on my end and try to solve it. Also, I know that these two libraries might be imp to you but can you once remove them and try to test again if it works and let me know?