Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
313 views
in Technique[技术] by (71.8m points)

android - focus on editText result in crash

I'm experiencing a really unusual behavior:

From today (no style, Gradle or layout changes done), every-time I click on an EditText or TextInputEditText (just set focus on them), the app crashes with the following error:

java.lang.ClassCastException: java.lang.ref.SoftReference cannot be cast to android.view.inputmethod.InputConnection at com.android.tools.profiler.support.profilers.EventProfiler$InputConnectionHandler.run(EventProfiler.java:330) at java.lang.Thread.run(Thread.java:833)

I searched on the net and I didn't find anything similar and at the moment I'm really without any idea.

I tried it on two different Huawei devices with Android 6.0 and both result in a crash.

If I run it on my phone (Oneplus 3, Android 7) I have no errors and the app works correctly.

What I tried:

  • Changing the layout, one of those who were crashing
  • Adding a simple EditText with no attributes set
  • Removing all code and leaving the Activity "blank"
  • Cleaning some gradle unused references
  • Uninstalling app from phone
  • Rebooting phone
  • Invalidating

Not a single solution worked. What is happening to my application?

Thanks all

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I had the same issue,my mobile is also Huawei with Android 6.0.You should set up android studio and close the android profiler in Settings.I wish that can help you .

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...