转:http://blog.csdn.net/voiceofnet/article/details/49866047

 

今天写代码的时候,突然发现平时用的好好的Log竟然报错,提示信息为:the logging tag can be at most 23 characters,was 27...

当前Android studio版本为1.4.1, sdk版本为23,可能是更新版本后,对应的API规范有调整,根据提示的意思Log.e(TAG,message)第二个参数的长度最大不能超过23个字符。之前用eclipse的时候,lint检查不通过的会有这个错误提醒,估计是这个出了问题。

google之后,在stackoverflow上发现了答案,即:关掉lint检查中针对Too Long Log Tag检查。解决方案有两个:

一、在设置中关闭

android  studio中the logging tag can be most 23 characters

 

二、在build.gradle中设置

 

[html] view plain copy
 
  1. lintOptions {  
  2.     disable 'LongLogTag'  
  3. }  


一劳永逸的做法是方案一,因为在build.gradle中设置只对当前项目有效;

相关文章:

  • 2021-05-11
  • 2022-12-23
  • 2021-10-05
  • 2022-12-23
  • 2021-12-07
  • 2021-09-24
  • 2021-06-04
  • 2022-12-23
猜你喜欢
  • 2021-08-22
  • 2021-08-31
  • 2022-12-23
  • 2022-12-23
  • 2021-06-23
  • 2021-10-02
  • 2021-12-08
相关资源
相似解决方案