iyegoroff / react-native-image-filter-kit

Various image filters for iOS & Android
MIT License
320 stars 43 forks source link

FrescoBackgroundExecutor java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/renderscript/Allocation$MipmapControl #34

Closed tnluan closed 4 years ago

tnluan commented 4 years ago

Please give me some advice to fix this issue on Android. Thank you so much.

RN 0.61.5 compileSdkVersion 29 buildToolsVersion 29

2020-03-27 01:48:50.455 4415-4759/com.purple.mcat E/AndroidRuntime: FATAL EXCEPTION: FrescoBackgroundExecutor-4
    Process: com.purple.mcat, PID: 4415
    java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/renderscript/Allocation$MipmapControl;
        at iyegoroff.imagefilterkit.utility.RenderscriptSingularPostProcessor$RenderscriptContext.<init>(RenderscriptSingularPostProcessor.java:23)
        at iyegoroff.imagefilterkit.nativeplatform.scriptintrinsic.ScriptIntrinsicConvolve3x3PostProcessor.processSingularRenderscript(ScriptIntrinsicConvolve3x3PostProcessor.java:51)
        at iyegoroff.imagefilterkit.utility.RenderscriptSingularPostProcessor.process(RenderscriptSingularPostProcessor.java:70)
        at com.facebook.imagepipeline.request.BasePostprocessor.process(BasePostprocessor.java:61)
        at iyegoroff.imagefilterkit.utility.MultiPostProcessor.process(MultiPostProcessor.java:68)
        at com.facebook.imagepipeline.producers.PostprocessorProducer$PostprocessorConsumer.postprocessInternal(PostprocessorProducer.java:247)
        at com.facebook.imagepipeline.producers.PostprocessorProducer$PostprocessorConsumer.doPostprocessing(PostprocessorProducer.java:217)
        at com.facebook.imagepipeline.producers.PostprocessorProducer$PostprocessorConsumer.access$600(PostprocessorProducer.java:73)
        at com.facebook.imagepipeline.producers.PostprocessorProducer$PostprocessorConsumer$2.run(PostprocessorProducer.java:175)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
        at com.facebook.imagepipeline.core.PriorityThreadFactory$1.run(PriorityThreadFactory.java:51)
        at java.lang.Thread.run(Thread.java:764)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.renderscript.Allocation$MipmapControl" on path: DexPathList[[zip file "/data/app/com.purple.mcat-mRgMzYb9n7II2q0pcCWMJQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.purple.mcat-mRgMzYb9n7II2q0pcCWMJQ==/lib/x86, /data/app/com.purple.mcat-mRgMzYb9n7II2q0pcCWMJQ==/base.apk!/lib/x86, /system/lib, /vendor/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at iyegoroff.imagefilterkit.utility.RenderscriptSingularPostProcessor$RenderscriptContext.<init>(RenderscriptSingularPostProcessor.java:23) 
        at iyegoroff.imagefilterkit.nativeplatform.scriptintrinsic.ScriptIntrinsicConvolve3x3PostProcessor.processSingularRenderscript(ScriptIntrinsicConvolve3x3PostProcessor.java:51) 
        at iyegoroff.imagefilterkit.utility.RenderscriptSingularPostProcessor.process(RenderscriptSingularPostProcessor.java:70) 
        at com.facebook.imagepipeline.request.BasePostprocessor.process(BasePostprocessor.java:61) 
        at iyegoroff.imagefilterkit.utility.MultiPostProcessor.process(MultiPostProcessor.java:68) 
        at com.facebook.imagepipeline.producers.PostprocessorProducer$PostprocessorConsumer.postprocessInternal(PostprocessorProducer.java:247) 
        at com.facebook.imagepipeline.producers.PostprocessorProducer$PostprocessorConsumer.doPostprocessing(PostprocessorProducer.java:217) 
        at com.facebook.imagepipeline.producers.PostprocessorProducer$PostprocessorConsumer.access$600(PostprocessorProducer.java:73) 
        at com.facebook.imagepipeline.producers.PostprocessorProducer$PostprocessorConsumer$2.run(PostprocessorProducer.java:175) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) 
        at com.facebook.imagepipeline.core.PriorityThreadFactory$1.run(PriorityThreadFactory.java:51) 
        at java.lang.Thread.run(Thread.java:764) 
iyegoroff commented 4 years ago

What is your rnifk version?

yairopro commented 4 years ago

Hi @iyegoroff I have the same problem. Maybe I can answer. What's RNIFK ?

react: 16.13.1
react-native: 0.62.2
react-native-image-filter-kit: 0.7.1
iyegoroff commented 4 years ago

Hi @yairopro rnifk is react-native-image-filter-kit. Your versions look OK, maybe this is a configuration problem - please check if you followed installation instructions

yairopro commented 4 years ago

I've followed the instructions. The library is well installed. I even started to use some filters like 1977, Aden, Brannan, Brooklyn, etc. They work nice. Thanks a lot for this library by the way.

The error happens only when I try to use some specific filters like Gingham or Hudson.

iyegoroff commented 4 years ago

The error happens only when I try to use some specific filters like Gingham or Hudson.

This means that renderscript was not configured properly.

Maybe you need just to clean the project cd android && ./gradlew clean before building.

yairopro commented 4 years ago

Even after a clean, it's still crashing when using those filters.

iyegoroff commented 4 years ago

Please check if you got the same error when running CustomNativeFilter example.

yairopro commented 4 years ago

The demo works perfectly.

image

iyegoroff commented 4 years ago

This means that something in your android/gradle project configuration conflicts with rnifk.

yairopro commented 4 years ago

I'll check.

s123121 commented 4 years ago

I have the same problem. I am not well-versed with android so I could not debug much (and the demo with perfectly). So unfortunately, I have to switch to gl-react