Search code examples
javaandroidimagecompressionabstract

error: Compressor is abstract; cannot be instantiated Android


I'm trying to compress an image using the zetbaitsu/Compressor, I even saw an tutorial on youtube but I'm getting this error.

error: Compressor is abstract; cannot be instantiated

this is the code.

try{
              compressed=new Compressor(this).compressToBitmap(compressedFile);
            }catch (IOException e){
                e.printStackTrace();
            }

I implemented the last version.

implementation 'id.zelory:compressor:2.1.0'

Can anyone help please?

Thanks ;D


Solution

  • Import id.zelory:compressor. Compressor In your Java file