Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Crash] android.renderscript.RSRuntimeException - ( RenderScript.java line 1333 & RenderScript.java line 1318 ) #2259

Open
raghav2945 opened this issue Feb 26, 2022 · 0 comments

Comments

@raghav2945
Copy link

We (Audiomack) started getting crashes from RenderScript, which is supposed to be deprecated from Android 12 forward, according to Google Docs. However, the current crash is primarily occurring on Android 10 and 9. We are unable to duplicate the same issue locally, despite sharing the stack-trace and screenshot obtained via Firebase for reference.

Infix Mobility and Techno Mobile are two of the major manufacturers where this problem has been reported.

Fatal Exception: android.renderscript.RSRuntimeException: Fatal error 4097, details: Allocation::Allocation, alloc failure
       at android.renderscript.RenderScript$MessageThread.run(RenderScript.java:1333)

I see you have a fallback method in the BlurTransformation class to handle such a crash for the exception thrown by the RSBlur class. However we are still seeing this crashes. Could you please assist us with this?

public Bitmap transform(Bitmap source) {

    int scaledWidth = source.getWidth() / mSampling;
    int scaledHeight = source.getHeight() / mSampling;

    Bitmap bitmap = Bitmap.createBitmap(scaledWidth, scaledHeight, Bitmap.Config.ARGB_8888);

    Canvas canvas = new Canvas(bitmap);
    canvas.scale(1 / (float) mSampling, 1 / (float) mSampling);
    Paint paint = new Paint();
    paint.setFlags(Paint.FILTER_BITMAP_FLAG);
    canvas.drawBitmap(source, 0, 0, paint);

    try {
      bitmap = RSBlur.blur(mContext, bitmap, mRadius);
    } catch (RSRuntimeException e) {
      bitmap = FastBlur.blur(bitmap, mRadius, true);
    }

    source.recycle();

    return bitmap;
  }

We are using below picasso library in our application

  1. implementation 'jp.wasabeef:picasso-transformations:2.4.0'
  2. implementation "com.squareup.picasso:picasso:2.8"

Screenshot

  1. RenderScript.java line 1333

Screenshot from 2022-02-26 14-49-32

  1. RenderScript.java line 1318

Screenshot from 2022-02-26 14-49-27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant