Giter Club home page Giter Club logo

Comments (13)

thomasleveil avatar thomasleveil commented on August 15, 2024 2

this might help

from android-signaturepad.

gcacace avatar gcacace commented on August 15, 2024 2

It would be great if someone could help looking into that, as unfortunately at the moment I don't have so much time.

from android-signaturepad.

huanting avatar huanting commented on August 15, 2024 1
  1. You can use thirty party image libs to manager the bitmap, such as fresco. They are optimize the memory, such as use ASM memory.
  2. When you create bitmap, you can set bitmap config to RGB_565 or ARGB_4444. I think it has very small effect, because the signature is black and white.
  3. At last, You make the bitmap small

from android-signaturepad.

thomasleveil avatar thomasleveil commented on August 15, 2024

Do you suspect svg to be part of that ?

from android-signaturepad.

gcacace avatar gcacace commented on August 15, 2024

I think the issue is related to the view size: currently the bitmap size depends on view width and height. I need to investigate how to limit that size, based on available heap.

from android-signaturepad.

biliboss avatar biliboss commented on August 15, 2024

@gcacace u already begin work in this? If not, i'll. I had a lot of crashes in enterprise software 😟

from android-signaturepad.

harshitjain07 avatar harshitjain07 commented on August 15, 2024

@gcacace can you please look into this issue on priority as I'm also getting a lot of crashes regularly in my application due to this.

from android-signaturepad.

Grimald avatar Grimald commented on August 15, 2024

Hi! I also got this bug at production app a week ago.

Lib version: com.github.gcacace:signature-pad:1.2.1

Device:

  • Brand: TCL
  • Model: 5056I
  • Orientation: Portrait
  • RAM free: 245.47 MB
  • Disk free: 7.49 GB

Operating System:

  • Version: 6.0.1
  • Orientation: Portrait
  • Rooted: No

Stack trace:
Fatal Exception: java.lang.OutOfMemoryError
Failed to allocate a 3548172 byte allocation with 3410256 free bytes and 3MB until OOM
dalvik.system.VMRuntime.newNonMovableArray (VMRuntime.java)
android.graphics.Bitmap.nativeCreate (Bitmap.java)
android.graphics.Bitmap.createBitmap (Bitmap.java:831)
android.graphics.Bitmap.createBitmap (Bitmap.java:808)
android.graphics.Bitmap.createBitmap (Bitmap.java:775)
com.github.gcacace.signaturepad.views.SignaturePad.ensureSignatureBitmap (SignaturePad.java:573)
com.github.gcacace.signaturepad.views.SignaturePad.clear (SignaturePad.java:157)
com.radaro.mvp.task_completion.view.SignatureFragmentController.lambda$setListeners$0$SignatureFragmentController (SignatureFragmentController.java:78)
com.radaro.mvp.task_completion.view.SignatureFragmentController$$Lambda$0.onClick (Unknown Source)
android.view.View.performClick (View.java:5205)
android.view.View$PerformClick.run (View.java:21164)
android.os.Handler.handleCallback (Handler.java:739)
android.os.Handler.dispatchMessage (Handler.java:95)
android.os.Looper.loop (Looper.java:148)
android.app.ActivityThread.main (ActivityThread.java:5417)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:726)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:616)

If someone has a working cure for this bug?

Have a nice day!

from android-signaturepad.

biliboss avatar biliboss commented on August 15, 2024

@Grimald take a look into previous comment. I reduced the size of bitmap and it solves the problem.

from android-signaturepad.

nishantt12 avatar nishantt12 commented on August 15, 2024

is this issue fixed? I am still getting the same error with the latest version.

from android-signaturepad.

abraaomelo avatar abraaomelo commented on August 15, 2024

Hello there !
I'm getting the following log:
E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 3319160) W/ActivityStopInfo: Bundle stats: W/ActivityStopInfo: PersistableBundle stats: [null] D/AndroidRuntime: Shutting down VM E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.fichaatendimento, PID: 27836 java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 3319160 bytes at android.app.servertransaction.PendingTransactionActions$StopInfo.run(PendingTransactionActions.java:161)

I was wondering if I could get some help about this.
You think it might be related to the messages wrote above ?
Regards.

from android-signaturepad.

BoykoDmytro avatar BoykoDmytro commented on August 15, 2024

Is there any updates?
android:saveEnabled="false" - hotfix for now.

from android-signaturepad.

realdadfish avatar realdadfish commented on August 15, 2024

The issue is not fixed in the most "recent" 1.3.1 from 2020. A simple workaround is to create a custom SignaturePad implementation like so an remove the dangling Bundle entry:

import android.content.Context
import android.os.Bundle
import android.os.Parcelable
import android.util.AttributeSet
import com.github.gcacace.signaturepad.views.SignaturePad

class FixedSignaturePad(context: Context, attrs: AttributeSet) : SignaturePad(context, attrs) {
    override fun onSaveInstanceState(): Parcelable {
        val bundle = super.onSaveInstanceState() as Bundle
        bundle.remove("signatureBitmap")
        return bundle
    }
}

A "proper" fix however would be to save the bitmap in the application's cacheDir and just save a pointer to that file in the saved instance state. It's hilarious to think in first place that saving a Bitmap in a save state is a good idea...

from android-signaturepad.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.