2017-11-01 7 views
0

Die App stürzt bei dieser Methode ab, zeigt aber kein Absturzprotokoll. Dies geschieht nur auf wenigen Geräten (z. B. HTC One M9), es funktioniert perfekt auf HTC Desire Pro 10 und Galaxy S6 Edge. App stürzt bei script.forEach ab (output); diese Linie.App Absturz bei Unschärfe Bild

private static Bitmap blur(Bitmap src) { 
    RenderScript rs = RenderScript.create(BaseApplication.getAppContext()); 
    final Allocation input = Allocation.createFromBitmap(rs, src); //use this constructor for best performance, because it uses USAGE_SHARED mode which reuses memory 
    final Allocation output = Allocation.createTyped(rs, input.getType()); 
    final ScriptIntrinsicBlur script = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs)); 
    script.setRadius(5f); 
    script.setInput(input); 
    script.forEach(output); 
    output.copyTo(src); 
    return src; 
    } 
+0

kein logcat wird angezeigt. ähnlicher Fall mit diesem https://stackoverflow.com/questions/18709301/android-renderscript-allocation-usage-shared-crash?rq=1 –

+0

11-01 19: 26: 33.587 20689-21107/com.ingic.aaloo A/libc: Fatales Signal 7 (SIGBUS), Code 2, Fehleradresse 0xbeb0d000 in tid 21107 (com.ingic.aaloo) 11-01 19: 26: 33.587 20689-21114/com.ingic.aaloo A/libc: Fatal Signal 7 (SIGBUS), Code 2, Fehleradresse 0xbeb0d000 in tid 21114 (com.ingic.aaloo) 11-01 19: 26: 33.588 20689-21111/com.ingic.aaloo A/libc: Fatales Signal 7 (SIGBUS), Code 2, Fehler addr 0xbeb0d000 in tid 21111 (com.ingic.aaloo) –

Antwort

0

Ich löste dieses Problem, dieses Problem geschah, weil meine Bitmap-Konfiguration nicht Bitmap.Config.ARGB_8888 war, haben wir es zu ARGB_8888 umwandeln sollten, bevor die Unschärfe anwenden.

Bitmap U8_4Bitmap; 
    if (yourBitmap.getConfig() == Bitmap.Config.ARGB_8888) { 
     U8_4Bitmap = yourBitmap; 
    } else { 
     U8_4Bitmap = yourBitmap.copy(Bitmap.Config.ARGB_8888, true); 
    }