开发工作过程中的遇到的坑_填坑向

1.eglCodecCommon: writeFully: failed: Broken pipe

转自:https://stackoverflow.com/questions/23855115/genymotion-crash-after-a-few-minutes


It's not really caused by your application, so don't worry.  
It often happens when you computer goes in sleep mode and when you come back Genymotion will throw this exception (it happens to me very often).  

In your specific case sounds like the device goes in sleep mode so a way to fix it is simply to enable "Always stay awake" in developers options.  

问题不是出自应用程序,而是模拟器或者模拟器与AS的连接问题(adb),重启模拟器即可解决

2.sever's certificate is not trusted

打开项目时,总是弹出警告框

解决办法

https://blog.csdn.net/u014764233/article/details/80046514

点击android studio左上角的File > Settings > Tools > Server Certificates > Accept non-trusted certificates automatically

意思为自动接受不可信的证书,将不再弹窗提醒。


3.    error inflating class imageview 报错

资源文件报错

有可能是资源文件的问题,建议更换资源文件排查

还有就是设置imageView图片时,用的是background属性,应该更正为app:srcCompat属性


4. IllegalStateException: Can not perform this action after onSaveInstanceState

更多参考 https://blog.csdn.net/edisonchang/article/details/49873669

我的问题是因为调用 popBackStack()在mainActivity中的onDestory()方法

正常的做法是在onBackPressed()中调用.改正后目前没有再次出现类似告警,原理待发现.

 popBackStack()更多查阅https://blog.csdn.net/qq_16247851/article/details/52793061


5 This Handler class should be static or leaks might occur (anonymous android.os.Handler)

更多参考 https://blog.csdn.net/banxiali/article/details/51494842

https://www.jianshu.com/p/0a274564a4b1

解决办法,实现一个静态类继承Hanlder,内部持有一个活动的弱引用,在使用的时候,获得当前活动的弱引用

猜你喜欢

转载自blog.csdn.net/rungby/article/details/80802587