在HTC D820U中调试,发现StackOverflowError.设备:HTC D820u,Android 6.0,HTC版本:1.0.0.D820u见日志:
01-11 10:55:33.101 11234-11234/com.xxx E/CrashReport:java.lang.StackOverflowError:堆栈大小为8MB,位于com.android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:42 )位于android.view.inputmethod.InputConnectionWrapper的com.android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43)的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82). com.android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43)中的commitText(InputConnectionWrapper.java:82)位于com的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82)位于com.android.tools.profiler.support.event的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82)上的.android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43) .InputConnectionWrapper.commitText(InputCo nnectionWrapper.java:43)在android.view上的com.android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43)的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82)位于android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java)的com.android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43)中的.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82) :82)位于com.android.tools的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82)的com.android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43).在com.android.tools.profiler.support.event.InputConnectionWrappe的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82)上的profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43)r.commitText(InputConnectionWrapper.java:43)位于com.android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43)的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82)位于android.view.inputmethod.InputConnectionWrapper.commitText的com.android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43)的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82) (InputConnectionWrapper.java:82)com的com.android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43)位于com的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82). android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43)位于com.android.tools.profiler.support.event的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82).一世 位于com.android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43)的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82)中的nputConnectionWrapper.commitText(InputConnectionWrapper.java:43)位于android.view.inputmethod.InputConnectionWrapper.commitText的com.android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43)的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82) (InputConnectionWrapper.java:82)com的com.android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43)位于com的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82). android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43)位于com.android.tools.prof的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82)iler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.j 01-11 10:55:33.101 11234-11234/com.xxx E/CrashReport:
++++++++++++++++++++++++++++++++++++++++++
关于日志,关于我的应用程序没有崩溃.这是Android的错误吗?还是HTC Rom的bug?
我有一个应用程序,可以很好地处理基于导航栏交互切换的多个片段.其中一个屏幕有多个文本字段,我决定订购这些字段,因此键盘"next"会自动将用户带到下一个可填写的文本字段nextFocusDown.最后一个导致导致RadioGroup显示"完成"按钮.
该领域是这样的(他们是内LinearLayout是内NestedScrollView内的另一个LinearLayout即根目录下FrameLayout):
<EditText
android:id="@+id/firstName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPersonName|textCapWords"
android:nextFocusDown="@id/lastName"
android:text="" />
<EditText
android:id="@+id/lastName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPersonName|textCapWords"
android:nextFocusDown="@id/email"
android:text="" />
<EditText
android:id="@+id/email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textEmailAddress"
android:nextFocusDown="@id/localId"
android:text="" />
Run Code Online (Sandbox Code Playgroud)
还有更多字段,其中一些包括文本提示等.
如果我运行应用程序,选择一个字段,然后点击"下一步"按钮,直到键盘自行消失 - 一切正常.当我选择一个字段时出现问题,键盘出现,然后我点击了导致键盘消失的安卓向下按钮.执行此操作后,此屏幕中的所有内容看起来都很好,一切正常,直到我切换片段,然后应用程序崩溃,我在日志中看到这些错误:
04-10 00:12:24.763 redacted E/AndroidRuntime: FATAL EXCEPTION: main
Process: redacted, PID: 24660
java.lang.NullPointerException: Attempt to invoke interface method 'void android.view.inputmethod.InputConnection.closeConnection()' on a null object reference
at android.view.inputmethod.InputConnectionWrapper.closeConnection(InputConnectionWrapper.java:270)
at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:541)
at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:85)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at …Run Code Online (Sandbox Code Playgroud) 我在inputmethod.InputConnection.finishComposingText()中得到一个NPE,Log消息如下:
java.lang.NullPointerException: Attempt to invoke interface method 'boolean android.view.inputmethod.InputConnection.finishComposingText()' on a null object reference
at android.view.inputmethod.InputConnectionWrapper.finishComposingText(InputConnectionWrapper.java:78)
at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:362)
at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:78)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5289)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
Run Code Online (Sandbox Code Playgroud)
我在Android 5中面对它,但在Android中运行良好.
该错误并未指定我的代码中的任何代码行,只是告诉库中的某些代码行.
每当我按下后退按钮从一个活动转移到主要活动时,我就会面对它.是的,其他活动也包含EditText.
我删除了softKeyboard的所有实例,我认为是由于这个原因
如果有人能提前帮助我,那将会很棒
我最近将我的android工作室更新到3.1版本,并将我的gradle更新到4.4版本.从那以后,当我点击EditText应该弹出一个软输入键盘时,我一直面临着这个app进入ANR的问题.点击EditText我看到有多个GC被触发,最终应用程序崩溃,并且ANR消息说堆栈溢出超过8 MB的大小.这是我看到的崩溃:http://crashes.to/s/77a48e5d43c.也粘贴在这里:
Fatal Exception: java.lang.StackOverflowError: stack size 8MB
at android.view.inputmethod.InputConnectionWrapper.reportFullscreenMode(InputConnectionWrapper.java:122)
at android.view.inputmethod.InputConnectionWrapper.reportFullscreenMode(InputConnectionWrapper.java:122)
at android.view.inputmethod.InputConnectionWrapper.reportFullscreenMode(InputConnectionWrapper.java:122)
at android.view.inputmethod.InputConnectionWrapper.reportFullscreenMode(InputConnectionWrapper.java:122)
at android.view.inputmethod.InputConnectionWrapper.reportFullscreenMode(InputConnectionWrapper.java:122)
at android.view.inputmethod.InputConnectionWrapper.reportFullscreenMode(InputConnectionWrapper.java:122)
at android.view.inputmethod.InputConnectionWrapper.reportFullscreenMode(InputConnectionWrapper.java:122)
at android.view.inputmethod.InputConnectionWrapper.reportFullscreenMode(InputConnectionWrapper.java:122)
at android.view.inputmethod.InputConnectionWrapper.reportFullscreenMode(InputConnectionWrapper.java:122)
at android.view.inputmethod.InputConnectionWrapper.reportFullscreenMode(InputConnectionWrapper.java:122)
at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:416)
at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:78)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5268)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:697)
Run Code Online (Sandbox Code Playgroud)
以下是我如何使用的片段EditText:
<android.support.design.widget.TextInputLayout
android:id="@+id/textInputLayout2"
android:layout_width="@dimen/login_screen_elem_width"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
app:layout_constraintStart_toStartOf="@+id/fbLogin"
app:layout_constraintTop_toBottomOf="@+id/fbLogin">
<android.support.design.widget.TextInputEditText
android:id="@+id/etFirstName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/first_name"
android:imeOptions="flagNoExtractUi|actionNext"
android:inputType="textPersonName"
android:maxLines="1"
android:textColor="@color/secondaryTextColour"
android:textSize="16dp" />
</android.support.design.widget.TextInputLayout>
Run Code Online (Sandbox Code Playgroud)
仅供参考:当我尝试点击我的文本项时,我也遇到了类似的问题PreferenceFragmentCompat.
android android-edittext android-anr-dialog android-studio android-gradle-plugin
android ×4