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

App crash during Feedback #48

Open
build3r opened this issue Nov 17, 2020 · 0 comments
Open

App crash during Feedback #48

build3r opened this issue Nov 17, 2020 · 0 comments

Comments

@build3r
Copy link
Contributor

build3r commented Nov 17, 2020

The app crashes when we click on submit feed back because the device does not support hardware bitmaps.
Please allow to disable hardware acceleration or disable the screenshot functionality completely.
Device: Xiaomi Redmi 6 Pro
Os: 8.1.0, MIUI Global 10.0
Logs:

    java.lang.IllegalStateException: Software rendering doesn't support hardware bitmaps
        at android.graphics.BaseCanvas.throwIfHwBitmapInSwMode(BaseCanvas.java:532)
        at android.graphics.BaseCanvas.throwIfCannotDraw(BaseCanvas.java:62)
        at android.graphics.BaseCanvas.drawBitmap(BaseCanvas.java:120)
        at android.graphics.Canvas.drawBitmap(Canvas.java:1434)
        at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:529)
        at coil.drawable.CrossfadeDrawable.draw(CrossfadeDrawable.kt:69)
        at android.widget.ImageView.onDraw(ImageView.java:1367)
        at android.view.View.draw(View.java:19226)
        at android.view.View.draw(View.java:19096)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
        at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1882)
        at android.view.View.draw(View.java:19094)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
        at android.view.View.draw(View.java:19229)
        at android.view.View.draw(View.java:19096)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
        at androidx.recyclerview.widget.RecyclerView.drawChild(RecyclerView.java:5030)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
        at android.view.View.draw(View.java:19229)
        at androidx.recyclerview.widget.RecyclerView.draw(RecyclerView.java:4429)
        at android.view.View.draw(View.java:19096)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
        at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1882)
        at android.view.View.draw(View.java:19094)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
        at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1882)
        at android.view.View.draw(View.java:19094)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
        at android.view.View.draw(View.java:19229)
        at androidx.core.widget.NestedScrollView.draw(NestedScrollView.java:1998)
        at android.view.View.draw(View.java:19096)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
        at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1882)
        at android.view.View.draw(View.java:19229)
        at android.view.View.draw(View.java:19096)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
        at androidx.fragment.app.FragmentContainerView.drawChild(FragmentContainerView.java:235)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
        at androidx.fragment.app.FragmentContainerView.dispatchDraw(FragmentContainerView.java:223)
        at android.view.View.draw(View.java:19094)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
        at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1882)
        at android.view.View.draw(View.java:19094)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
        at android.view.View.draw(View.java:19094)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
        at android.view.View.draw(View.java:19094)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
        at android.view.View.draw(View.java:19094)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
        at android.view.View.draw(View.java:19094)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
2020-11-17 13:33:17.681 28782-28782/**** E/Falcon:     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
        at android.view.View.draw(View.java:19229)
        at com.android.internal.policy.DecorView.draw(DecorView.java:791)
        at com.jraska.falcon.Falcon.drawRootToBitmap(Falcon.java:177)
        at com.jraska.falcon.Falcon.drawRootsToBitmap(Falcon.java:162)
        at com.jraska.falcon.Falcon.takeBitmapUnchecked(Falcon.java:127)
        at com.jraska.falcon.Falcon.takeScreenshotBitmap(Falcon.java:90)
        at com.linkedin.android.shaky.Shaky.getScreenshotBitmap(Shaky.java:226)
        at com.linkedin.android.shaky.Shaky.doStartFeedbackFlow(Shaky.java:143)
        at com.linkedin.android.shaky.Shaky.access$100(Shaky.java:49)
        at com.linkedin.android.shaky.Shaky$1.onReceive(Shaky.java:259)
        at androidx.localbroadcastmanager.content.LocalBroadcastManager.executePendingBroadcasts(LocalBroadcastManager.java:313)
        at androidx.localbroadcastmanager.content.LocalBroadcastManager$1.handleMessage(LocalBroadcastManager.java:121)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:171)
        at android.app.ActivityThread.main(ActivityThread.java:6651)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)
2020-11-17 13:33:17.725 28782-28782/**& D/AndroidRuntime: Shutting down VM
2020-11-17 13:33:17.728 28782-28782/***E/AndroidRuntime: FATAL EXCEPTION: main
    Process: ***, PID: 28782
    java.lang.IllegalStateException: Software rendering doesn't support hardware bitmaps
        at android.graphics.BaseCanvas.throwIfHwBitmapInSwMode(BaseCanvas.java:532)
        at android.graphics.BaseCanvas.throwIfCannotDraw(BaseCanvas.java:62)
        at android.graphics.BaseCanvas.drawBitmap(BaseCanvas.java:120)
        at android.graphics.Canvas.drawBitmap(Canvas.java:1434)
        at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:529)
        at coil.drawable.CrossfadeDrawable.draw(CrossfadeDrawable.kt:69)
        at android.widget.ImageView.onDraw(ImageView.java:1367)
        at android.view.View.draw(View.java:19226)
        at android.view.View.draw(View.java:19096)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
        at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1882)
        at android.view.View.draw(View.java:19094)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
        at android.view.View.draw(View.java:19229)
        at android.view.View.draw(View.java:19096)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
        at androidx.recyclerview.widget.RecyclerView.drawChild(RecyclerView.java:5030)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
        at android.view.View.draw(View.java:19229)
        at androidx.recyclerview.widget.RecyclerView.draw(RecyclerView.java:4429)
        at android.view.View.draw(View.java:19096)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
        at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1882)
        at android.view.View.draw(View.java:19094)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
        at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1882)
        at android.view.View.draw(View.java:19094)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
        at android.view.View.draw(View.java:19229)
        at androidx.core.widget.NestedScrollView.draw(NestedScrollView.java:1998)
        at android.view.View.draw(View.java:19096)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
        at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1882)
        at android.view.View.draw(View.java:19229)
        at android.view.View.draw(View.java:19096)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
        at androidx.fragment.app.FragmentContainerView.drawChild(FragmentContainerView.java:235)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
        at androidx.fragment.app.FragmentContainerView.dispatchDraw(FragmentContainerView.java:223)
        at android.view.View.draw(View.java:19094)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
        at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1882)
        at android.view.View.draw(View.java:19094)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
        at android.view.View.draw(View.java:19094)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
        at android.view.View.draw(View.java:19094)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
        at android.view.View.draw(View.java:19094)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
        at android.view.View.draw(View.java:19094)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
2020-11-17 13:33:17.729 28782-28782/*** E/AndroidRuntime:     at android.view.View.draw(View.java:19229)
        at com.android.internal.policy.DecorView.draw(DecorView.java:791)
        at com.linkedin.android.shaky.Utils.capture(Utils.java:110)
        at com.linkedin.android.shaky.Shaky.getScreenshotBitmap(Shaky.java:231)
        at com.linkedin.android.shaky.Shaky.doStartFeedbackFlow(Shaky.java:143)
        at com.linkedin.android.shaky.Shaky.access$100(Shaky.java:49)
        at com.linkedin.android.shaky.Shaky$1.onReceive(Shaky.java:259)
        at androidx.localbroadcastmanager.content.LocalBroadcastManager.executePendingBroadcasts(LocalBroadcastManager.java:313)
        at androidx.localbroadcastmanager.content.LocalBroadcastManager$1.handleMessage(LocalBroadcastManager.java:121)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:171)
        at android.app.ActivityThread.main(ActivityThread.java:6651)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)```
kkoser pushed a commit that referenced this issue Mar 25, 2024
…bitmaps (#73)

Using PixelCopy API in Android O and beyond to prevent the IllegalState crash caused by hardware bitmaps. Should fix this issue: #48 (comment)

This solution is based on recommendation here: https://bumptech.github.io/glide/doc/hardwarebitmaps.html#whats-broken-when-we-use-hardware-bitmaps

* Fix shaky crash due to IllegalStateException

* Return null bitmap incase of no base activity and other formatting updates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant