Android的 - E /表面:queueBuffer:错误排队缓冲区表面纹理,-22坠毁 [英] Android - E/Surface﹕ queueBuffer: error queuing buffer to SurfaceTexture, -22 crash
问题描述
我需要调试我并找出为什么我的Android应用程序不断崩溃一些帮助。应用程序崩溃其中有一个列表视图页面上,每个列表视图行都有一个图像,并在它的一些文字。我创建了一个缓存类存储在ListView图像的所有位图。经过约逗留的页面(与列表视图的页面)的应用程序崩溃的一个小时,这是我在logcat的控制台中看到。我不明白此崩溃是如何发生的,其根本原因会非常有帮助的任何提示或任何建议。我很抱歉,如果信息是不够的。
07-21 00:47:07.143 2047年至2423年/ com.app E /地块:地块:: writeDupFileDescriptor失败:
FD = 931标志= 0 ERR = 0(成功)
dupFd = -1 dupErr = 24(打开的文件太多)标志= -1 ERR = 9(错误的文件数)
07-21 00:47:07.172 2047年至2423年/ com.app E /表面:queueBuffer:错误排队缓冲区表面纹理,-22
07-21 00:47:07.172 2047年至2423年/ com.app W /肾上腺EGLSUB:或其可SwapBuffers:1344计算值:未能queueBuffer
07-21 00:47:07.172 2047年至2423年/ com.app W /肾上腺EGL:其中,qeglDrvAPI_eglSwapBuffers:3791计算值:EGL_BAD_SURFACE
07-21 00:47:07.595 2047年至2423年/ com.app E /地块:地块:: writeDupFileDescriptor失败:。 (同样的错误与上述被重复了几次)
。
。07-21 00:47:11.685 2047年至2423年/ com.app W /肾上腺EGLSUB:或其可SwapBuffers:1344计算值:未能queueBuffer
07-21 00:47:11.685 2047年至2423年/ com.app W /肾上腺EGL:其中,qeglDrvAPI_eglSwapBuffers:3791计算值:EGL_BAD_SURFACE
07-21 00:47:12.128 2047年至2423年/ com.app W /肾上腺GSL:其中,gsl_ldd_control:416计算值:FD的ioctl 28 code 0xc0140933(IOCTL_KGSL_TIMESTAMP_EVENT)失败:错误号24打开的文件太多。 (同样的错误与上述被重复了几次)
。
。07-21 00:47:17.839 2047年至2047年/ com.app W / InputMethodManager:IME死:com.android.inputmethod.latin / .LatinIME android.os.TransactionTooLargeException
我也在我的XML布局,如果这是任何有帮助的。
<?XML版本=1.0编码=UTF-8&GT?;
<的FrameLayout的xmlns:机器人=http://schemas.android.com/apk/res/android
机器人:layout_width =match_parent
机器人:layout_height =match_parent
机器人:ID =@ + ID /的FrameLayout
机器人:背景=@彩色/黑白>< ImageView的
机器人:layout_width =225dp
机器人:layout_height =225dp
机器人:阿尔法=0.3
机器人:ID =@ + ID / background_image
机器人:layout_gravity =中心
机器人:背景=@绘制/ visual_background_animation_list/>
< android.support.v4.widget.DrawerLayout的xmlns:机器人=http://schemas.android.com/apk/res/android
机器人:ID =@ + ID / drawer_layout
机器人:layout_width =match_parent
机器人:layout_height =match_parent
机器人:layout_gravity =开始>
<! - 的主要内容视图 - >
< RelativeLayout的
机器人:layout_width =match_parent
机器人:layout_height =match_parent> < RelativeLayout的
机器人:ID =@ + ID / top_header
机器人:layout_width =match_parent
机器人:layout_height =WRAP_CONTENT
机器人:layout_alignParentTop =真
机器人:背景=@绘制/ background_holo_dark> < ImageView的
机器人:ID =@ + ID / play_pause_button
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:layout_alignParentLeft =真/> <搜索栏
机器人:layout_marginLeft =75dp
机器人:ID =@ + ID / seek_bar
机器人:layout_width =match_parent
机器人:layout_height =WRAP_CONTENT/> < ImageView的
机器人:ID =@ + ID / NXT
机器人:layout_width =60dp
机器人:layout_height =60dp
机器人:layout_alignParentRight =真/> <的TextView 机器人:layout_alignLeft =@ + ID / NXT 机器人:layout_below =@ + ID / seek_bar
机器人:ID =@ + ID / CURR
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT/> <的TextView 机器人:layout_alignRight =@ + ID / NXT 机器人:layout_below =@ + ID / seek_bar
机器人:ID =@ + ID / curr_2
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT/> < / RelativeLayout的> <的FrameLayout
机器人:ID =@ + ID / content_frame
机器人:layout_width =match_parent
机器人:layout_height =match_parent
机器人:layout_below =@ ID / top_header> < ListView控件
机器人:ID =@ + ID / another_list
机器人:layout_width =match_parent
机器人:layout_height =match_parent/> < /&的FrameLayout GT;
< / RelativeLayout的> <! - 导航抽屉 - > < RelativeLayout的
机器人:ID =@ + ID /抽屉
机器人:layout_width =240dp
机器人:layout_height =match_parent
机器人:layout_gravity =开始
机器人:背景=@机器人:彩色/ darker_gray
机器人:方向=垂直> < ListView控件
机器人:ID =@ + ID / another_list_2
机器人:layout_width =240dp
机器人:layout_height =match_parent
机器人:layout_gravity =开始
机器人:choiceMode =singleChoice/>
< / RelativeLayout的>
< /android.support.v4.widget.DrawerLayout>
< /&的FrameLayout GT;
我也想提一提,我有它运行,并正在显示该应用程序的背景图像的动画列表。
抽屉式导航栏的布局
布局抽屉式导航
< TableLayout的xmlns:机器人=http://schemas.android.com/apk/res/android
机器人:layout_width =match_parent
机器人:layout_height =match_parent>
<&的TableRow GT;
<的TextView
机器人:ID =@ + ID /名1/>
< /&的TableRow GT;
<&的TableRow GT;
<的TextView
机器人:ID =@ + ID /名2/>
< /&的TableRow GT;
< / TableLayout>
和列表视图的布局
<的RelativeLayout的xmlns:机器人=http://schemas.android.com/apk/res/android
的xmlns:工具=http://schemas.android.com/tools
机器人:layout_width =match_parent
机器人:layout_height =match_parent
机器人:知名度=隐形>
< ImageView的
机器人:ID =@ + ID / image_on_left
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT/>< RelativeLayout的
机器人:ID =@ + ID / relative_layout_id
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:layout_toRightOf =@ + ID / image_on_left> <的TextView
机器人:ID =@ + ID / TITLE1
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT/> < RelativeLayout的
机器人:ID =@ + ID / relative_layout_title2
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:layout_below =@ + ID / TITLE1> <的TextView
机器人:ID =@ + ID /标题2
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT/> < / RelativeLayout的> < ImageView的
机器人:ID =@ + ID / another_image
机器人:layout_alignParentRight =真/>
< / RelativeLayout的>< / RelativeLayout的>
我没有在网络上,在我的code一些研究,发现了很多内存泄漏。我改变了一些事情,摆脱错误的。
-
我确信,我的背景没有被我的任何辅助类(基本上是我的实用工具类)缓存
-
此外,我并没有在我的列表视图使用holder类
所以我添加了以下声明,我的自定义适配器类
静态类ViewHolder {
TextView的名称;
ImageView的ImageView的;
}@覆盖
公共查看getView(INT位置,查看convertView,父母的ViewGroup){
ViewHolder viewHolder =新ViewHolder();
....
convertView.setTag(viewHolder);
}
I needed some help in debugging my and finding out why my android application keeps on crashing. The app crashes on a page which has a listview and each listview row has an image and some text in it. I have created a cache class for storing all the bitmaps of the images in the listview. After about staying for an hour on that page(the page with the listview) the app crashes and this is what I see in the Logcat console. I cannot understand how this crash is happening, any tips or any suggestions on its root cause will extremely helpful. I apologize if the information is insufficient.
07-21 00:47:07.143 2047-2423/com.app E/Parcel﹕ Parcel::writeDupFileDescriptor failed:
fd=931 flags=0 err=0(Success)
dupFd=-1 dupErr=24(Too many open files) flags=-1 err=9(Bad file number)
07-21 00:47:07.172 2047-2423/com.app E/Surface﹕ queueBuffer: error queuing buffer to SurfaceTexture, -22
07-21 00:47:07.172 2047-2423/com.app W/Adreno-EGLSUB﹕ <SwapBuffers:1344>: failed to queueBuffer
07-21 00:47:07.172 2047-2423/com.app W/Adreno-EGL﹕ <qeglDrvAPI_eglSwapBuffers:3791>: EGL_BAD_SURFACE
07-21 00:47:07.595 2047-2423/com.app E/Parcel﹕ Parcel::writeDupFileDescriptor failed:
. (the same error as above gets repeated a couple of times)
.
.
07-21 00:47:11.685 2047-2423/com.app W/Adreno-EGLSUB﹕ <SwapBuffers:1344>: failed to queueBuffer
07-21 00:47:11.685 2047-2423/com.app W/Adreno-EGL﹕ <qeglDrvAPI_eglSwapBuffers:3791>: EGL_BAD_SURFACE
07-21 00:47:12.128 2047-2423/com.app W/Adreno-GSL﹕ <gsl_ldd_control:416>: ioctl fd 28 code 0xc0140933 (IOCTL_KGSL_TIMESTAMP_EVENT) failed: errno 24 Too many open files
. (the same error as above gets repeated a couple of times)
.
.
07-21 00:47:17.839 2047-2047/com.app W/InputMethodManager﹕ IME died: com.android.inputmethod.latin/.LatinIME android.os.TransactionTooLargeException
I am also adding my xml layout if that is any helpful
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/framelayout"
android:background="@color/black">
<ImageView
android:layout_width="225dp"
android:layout_height="225dp"
android:alpha="0.3"
android:id="@+id/background_image"
android:layout_gravity="center"
android:background="@drawable/visual_background_animation_list"/>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="start">
<!-- The main content view -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/top_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="@drawable/background_holo_dark">
<ImageView
android:id="@+id/play_pause_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"/>
<SeekBar
android:layout_marginLeft="75dp"
android:id="@+id/seek_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<ImageView
android:id="@+id/nxt"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_alignParentRight="true"/>
<TextView
android:layout_alignLeft="@+id/nxt"
android:layout_below="@+id/seek_bar"
android:id="@+id/curr"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_alignRight="@+id/nxt"
android:layout_below="@+id/seek_bar"
android:id="@+id/curr_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RelativeLayout>
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/top_header">
<ListView
android:id="@+id/another_list"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</FrameLayout>
</RelativeLayout>
<!-- The navigation drawer -->
<RelativeLayout
android:id="@+id/drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@android:color/darker_gray"
android:orientation="vertical">
<ListView
android:id="@+id/another_list_2"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice" />
</RelativeLayout>
</android.support.v4.widget.DrawerLayout>
</FrameLayout>
I also wanted to mention that I have an animation-list which runs and is being displayed as background image of this application.
Layout of the navigation drawer
layout for navigation drawer
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TableRow>
<TextView
android:id="@+id/name1"/>
</TableRow>
<TableRow>
<TextView
android:id="@+id/name2"/>
</TableRow>
</TableLayout>
And the layout of the listview
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="invisible">
<ImageView
android:id="@+id/image_on_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<RelativeLayout
android:id="@+id/relative_layout_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/image_on_left">
<TextView
android:id="@+id/title1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<RelativeLayout
android:id="@+id/relative_layout_title2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/title1">
<TextView
android:id="@+id/title2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RelativeLayout>
<ImageView
android:id="@+id/another_image"
android:layout_alignParentRight="true"/>
</RelativeLayout>
</RelativeLayout>
I did some research on the net and in my code and found out that were many memory leaks. I changed a few things to get rid of that error.
I made sure that my context was not being cached in any of my helper classes (basically my utility classes)
Also I was not using a holder class in my listview
So I added the following declaration in my Custom Adapter class
static class ViewHolder {
TextView name;
ImageView imageView;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder = new ViewHolder();
....
convertView.setTag(viewHolder);
}
这篇关于Android的 - E /表面:queueBuffer:错误排队缓冲区表面纹理,-22坠毁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!