1

I am trying to save an array of bitmaps as webp image in android, but while processing more than one, the application getting terminated.

    for(int i=0;i<bitmapArr.length;i++){
                        try{
                            FileOutputStream fileOutputStream = new FileOutputStream(file);
                            bitmapArr[i].compress(Bitmap.CompressFormat.WEBP,100,fileOutputStream);
                            fileOutputStream.close();
                        }catch (Exception e) {
                            e.printStackTrace();
                        }
                    }

Exception:

A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x6e800000 in tid 19366
c0d3er
  • 51
  • 2
  • 5
  • 2
    It might be cause _Out of Memory_ exception. – Piyush Nov 28 '18 at 13:12
  • @Piyush I added the exception – c0d3er Nov 28 '18 at 13:14
  • 1
    This is not the proper exception. Have you checked [this](https://stackoverflow.com/questions/34632379/encode-bitmap-to-webp-with-libwebp-on-android-pre-api-14-device)? If you want to bitmap to _WebP_ – Piyush Nov 28 '18 at 13:15

1 Answers1

0

Try disabling Android hardware acceleration in your manifest.

android:hardwareAccelerated="false"

Read this post for same issues.Read here

Ramchandra Singh
  • 530
  • 4
  • 15