error: Compressor is abstract; cannot be instantiated Android

Issue

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

Answered By – Soniya

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published