BugList 丨 No known package when getting name for resource number 0x0be977f2
Posted 左郁
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了BugList 丨 No known package when getting name for resource number 0x0be977f2相关的知识,希望对你有一定的参考价值。
No known package when getting name for resource number 0x0be977f2错误
错误提示信息:
W/ResourceType(6991):
No package identifier when getting value for resource number 0x0be977f2
W/dalvikvm(8564): threadid=1: thread exiting with uncaught exception (group=0x415f7498)
代码位置:
private int count;
textView.setText(count);
错误原因:
主要是因为TextView的setText方法会把传入的int类型的变量当做资源Id到项目中查询资源,而资源中却找不到相应的数值,就会报NotFoundException的错误。
在android中利用id来索引资源的地方很多(如:Toast.makeText()等),所以如果不小心往方法中传入int类型的参数,虽然编译时IDE不会报错,但是运行时,很容易因找不到对应的资源而报错。
解决方法:转换为字符串类型
private int count;
textView.setText(String.valueOf(count));
以上是关于BugList 丨 No known package when getting name for resource number 0x0be977f2的主要内容,如果未能解决你的问题,请参考以下文章
phone number is not known @w@ have no phone, and thus no phone number
安卓编译报错:missing and no known to make it
There is no known eureka server; cluster server list is empty
ES三节点重启后报错no known master node
MacOS上的AirConsole Unity包错误:SocketException No such host is known