You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Christiaan Rakowski (JIRA)" <ji...@apache.org> on 2014/03/11 11:21:45 UTC

[jira] [Comment Edited] (CB-5999) App crashes on Nexus 5/Kitkat 4.4.2 with error "Unable to lock surface"

    [ https://issues.apache.org/jira/browse/CB-5999?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13930185#comment-13930185 ] 

Christiaan Rakowski edited comment on CB-5999 at 3/11/14 10:20 AM:
-------------------------------------------------------------------

It's taken a while, but we have finally found the actual cause of this issue.

We were calling the app.initialize function, which binds the ondeviceready event and such, in a script tag at the bottom of the body.
Whilst this worked fine before, when we moved the project over this didn't work on the Nexus 5, and resulted in the above crash.
When moving this code to the body's onload event, it all ended up working again.

I don't know how this lead to said crash, but when toggling this back and forth the crashing also changed accordingly.
I will leave this here for future reference, and hope to save someone else some time!



was (Author: csrakowski):
It's taken a while, but we have finally found the actual cause of this issue.

We were calling the app.initialize function, which binds the ondeviceready event and such, in a script tag at the bottom of the body.
Whilst this worked fine before, when we moved the project over this did't work on the Nexus 5, and resulted in the above crash.
When moving this code to the body's onload event, it all ended up working again.

I don't know how this lead to said crash, but when toggling this back and forth the crashing also changed accordingly.
I will leave this here for future reference, and hope to save someone else some time!


> App crashes on Nexus 5/Kitkat 4.4.2 with error "Unable to lock surface"
> -----------------------------------------------------------------------
>
>                 Key: CB-5999
>                 URL: https://issues.apache.org/jira/browse/CB-5999
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 3.3.0
>         Environment: Published from Windows 8.1 Professional, using ADT v22.2.1-833290 and Cordova 3.3.1-0.3.0
> Published to fresh out of box Nexus 5, running KitKat 4.4.2 (KOT49H)
>            Reporter: Christiaan Rakowski
>            Priority: Minor
>
> We have a cordova app which was developed for iOS, and runs fine there.
> Now we are porting it over to Android and we get the following crash during start up:
> {{{quote}
> 02-10 13:39:11.231: E/Surface(31190): dequeueBuffer failed (Invalid argument)
> 02-10 13:39:11.241: E/ViewRootImpl(31190): Could not lock surface
> 02-10 13:39:11.241: E/ViewRootImpl(31190): java.lang.IllegalArgumentException
> 02-10 13:39:11.241: E/ViewRootImpl(31190): 	at android.view.Surface.nativeLockCanvas(Native Method)
> 02-10 13:39:11.241: E/ViewRootImpl(31190): 	at android.view.Surface.lockCanvas(Surface.java:243)
> 02-10 13:39:11.241: E/ViewRootImpl(31190): 	at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2435)
> 02-10 13:39:11.241: E/ViewRootImpl(31190): 	at android.view.ViewRootImpl.draw(ViewRootImpl.java:2409)
> 02-10 13:39:11.241: E/ViewRootImpl(31190): 	at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2253)
> 02-10 13:39:11.241: E/ViewRootImpl(31190): 	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1883)
> 02-10 13:39:11.241: E/ViewRootImpl(31190): 	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000)
> 02-10 13:39:11.241: E/ViewRootImpl(31190): 	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5670)
> 02-10 13:39:11.241: E/ViewRootImpl(31190): 	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
> 02-10 13:39:11.241: E/ViewRootImpl(31190): 	at android.view.Choreographer.doCallbacks(Choreographer.java:574)
> 02-10 13:39:11.241: E/ViewRootImpl(31190): 	at android.view.Choreographer.doFrame(Choreographer.java:544)
> 02-10 13:39:11.241: E/ViewRootImpl(31190): 	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
> 02-10 13:39:11.241: E/ViewRootImpl(31190): 	at android.os.Handler.handleCallback(Handler.java:733)
> 02-10 13:39:11.241: E/ViewRootImpl(31190): 	at android.os.Handler.dispatchMessage(Handler.java:95)
> 02-10 13:39:11.241: E/ViewRootImpl(31190): 	at android.os.Looper.loop(Looper.java:136)
> 02-10 13:39:11.241: E/ViewRootImpl(31190): 	at android.app.ActivityThread.main(ActivityThread.java:5017)
> 02-10 13:39:11.241: E/ViewRootImpl(31190): 	at java.lang.reflect.Method.invokeNative(Native Method)
> 02-10 13:39:11.241: E/ViewRootImpl(31190): 	at java.lang.reflect.Method.invoke(Method.java:515)
> 02-10 13:39:11.241: E/ViewRootImpl(31190): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
> 02-10 13:39:11.241: E/ViewRootImpl(31190): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
> 02-10 13:39:11.241: E/ViewRootImpl(31190): 	at dalvik.system.NativeStart.main(Native Method)
> {quote}}}
> I have tried attaching the Chrome debug bridge, but that gave me no additional information.
> I did some searching online, but in all the posts I found people using OpenGL directly, but none of them had a real solution either. Most of the posts were from people running on Snapdragon 800 devices though.
> I assume css3 transitions/transforms get translated to OpenGL by the ChromeWebView, so I think this might be related to the SoC and how it handles OpenGL. I currently don't have access to a different Android device, so I can't do more testing with that.
> I have tested the Hello World application, and that did run fine on the Nexus 5.
> If you have any tests you would like me to run or need addition information, please let me know.
> UPDATE:
> We were calling the app.initialize function, which binds the ondeviceready event and such, in a script tag at the bottom of the body.
> Whilst this worked fine before, when we moved the project over this didn't work on the Nexus 5, and resulted in the above crash.
> When moving this code to the body's onload event, it all ended up working again.



--
This message was sent by Atlassian JIRA
(v6.2#6252)