
安卓error
文章平均质量分 51
日常编程中出现的错误集合
Barryjacket
这个作者很懒,什么都没留下…
展开
-
Assignments are not expressions,and only expressions are allowed in this context
kotlin中不提倡将=当作表达式错误代码StringBuilder body = new StringBuilder();String nextLine;while ((nextLine = bufferReader.readLine()) != null) { body.append(nextLine); body.append('\n');}修改后的正确代码将判断和赋值语句分开StringBuilder body = new StringBuilder();String ne原创 2021-07-13 14:42:59 · 483 阅读 · 0 评论 -
使用ViewBinding时遇到 java.lang.ClassCastException: android.widget.RelativeLayout cannot be
提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档使用ViewBinding时遇到 java.lang.ClassCastException: android.widget.RelativeLayout cannot be cast to cast to android.widget.TextView<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.a原创 2021-06-29 10:58:17 · 1020 阅读 · 0 评论 -
unable to find valid certification path to requested target 报错的解决方法
AndroidStudio Cause: unable to find valid certification path to requested target 报错的解决方法项目场景:问题描述:原因分析:解决方案:项目场景:在使用AS4.2.1版本时,新建一个例子工程,出现了以上错误问题描述:在我们使用Gradle搭建安卓项目骨架时,经常会遇到appcompat-v7找不到依赖的情况或者是需要可靠的认证路径,其报的异常故障码如下:unable to find valid certificat原创 2021-06-11 16:03:06 · 2311 阅读 · 2 评论 -
android.content.res.Resources$NotFoundException: String resource ID #0xd
android.content.res.Resources$NotFoundException: String resource ID #0xd运行出现上述异常。holder.tvAge.setText(bean.getAge());其中tvAge是TextView类型,bean.getAge()是int类型。setText设置的是String类型。由于类型不一致,所以出现了上述异常。需要把int类型转为String类型。修改后的正确代码holder.tvAge.setText(String.v翻译 2020-09-29 17:37:58 · 304 阅读 · 0 评论 -
Android Studio控制台或者界面显示中文乱码
Android Studio控制台或者界面显示中文乱码如何修改#错误界面的显示效果如何修改设置字体为YaHei即可原创 2020-09-28 10:06:32 · 313 阅读 · 0 评论