Calling RS with no context active
See original GitHub issueHi,
Blurview v. 1.3.4
Been using this library for months. Just started getting this error.
Fatal Exception: android.renderscript.RSInvalidStateException: Calling RS with no Context active.
at android.renderscript.RenderScript.validate(RenderScript.java:1237)
at android.renderscript.Allocation.createFromBitmap(Allocation.java:2798)
at android.renderscript.Allocation.createFromBitmap(Allocation.java:3062)
at eightbitlab.com.blurview.RenderScriptBlur.blur(RenderScriptBlur.java:47)
at eightbitlab.com.blurview.BlockingBlurController.blurAndSave(BlockingBlurController.java:1241)
at eightbitlab.com.blurview.BlurView.draw(BlurView.java:57)
at android.view.View.updateDisplayListIfDirty(View.java:16200)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3758)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3738)
at android.view.View.updateDisplayListIfDirty(View.java:16163)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3758)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3738)
at android.view.View.updateDisplayListIfDirty(View.java:16163)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3758)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3738)
at android.view.View.updateDisplayListIfDirty(View.java:16163)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3758)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3738)
at android.view.View.updateDisplayListIfDirty(View.java:16163)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3758)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3738)
at android.view.View.updateDisplayListIfDirty(View.java:16163)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3758)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3738)
at android.view.View.updateDisplayListIfDirty(View.java:16163)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3758)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3738)
at android.view.View.updateDisplayListIfDirty(View.java:16163)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3758)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3738)
at android.view.View.updateDisplayListIfDirty(View.java:16163)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3758)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3738)
at android.view.View.updateDisplayListIfDirty(View.java:16163)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3758)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3738)
at android.view.View.updateDisplayListIfDirty(View.java:16163)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3758)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3738)
at android.view.View.updateDisplayListIfDirty(View.java:16163)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3758)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3738)
at android.view.View.updateDisplayListIfDirty(View.java:16163)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3758)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3738)
at android.view.View.updateDisplayListIfDirty(View.java:16163)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3758)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3738)
at android.view.View.updateDisplayListIfDirty(View.java:16163)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3758)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3738)
at android.view.View.updateDisplayListIfDirty(View.java:16163)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:676)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:682)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:796)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2989)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2783)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2374)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1364)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6763)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:923)
at android.view.Choreographer.doCallbacks(Choreographer.java:735)
at android.view.Choreographer.doFrame(Choreographer.java:667)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:909)
at android.os.Handler.handleCallback(Handler.java:761)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6524)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)
Any idea?
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (7 by maintainers)
Top Results From Across the Web
RSInvalidStateException with RenderScript on Android
I've seen this on some old devices, it's a bug. It's not a bug in the code above. However, there is a major...
Read more >RSInvalidStateException - Android Developers
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. final Class<?> ......
Read more >rs/java/android/renderscript/RenderScript.java - Google Git
This class provides access to a RenderScript context, which controls RenderScript ... throw new RSInvalidStateException("Calling RS with no Context active.
Read more >Bug: cannot instantiate RenderScript on [37056129]
RSRuntimeException: Failure to create platform RenderScript context at android.app. ... RSInvalidStateException: Calling RS with no Context active.
Read more >JAX-RS No application context active seam 2.1 - JBoss.org
CategoryAction.class, true); The error occurs trying to call 'Component.getInstance'... The non-seam aspect of the service works just no seam ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
glide-transformations
should just stop callingreleaseAllContexts
. It can break more than this librarySo I spent quite a lot of time investigating this crash.
The conclusion is - from library’s POV it’s impossible to call RS without context, at least on API 23+. I’m obtaining it in BlurAlgorithm’s constructor to use in the same object. Eventually,
destroy()
is called on RS and I thought it could be an issue in certain cases if you are accidentally reusing the same BlurAlgorithm. But, on API 23+destroy()
is a no-op, because of changes in SDK.So I have only couple of potential explanations to the problem:
Long story short, at this point I’m not able to fix it, and I have only 3 suggestions for you:
try-catch
com.eightbitlab:supportrenderscriptblur
, maybe Support Renderscript doesn’t have this issue.