Android Studio打包错误Error:Error: Expected resource of type id [ResourceType]

原文地址:https://blog.csdn.net/sinat_31311947/article/details/59094921

AS打包经常会报这样的错误,特别是在使用SharedSDK时:

[cpp]  view plain  copy
  1. E:\AndroidStudioProjects\ManagerClient\app\src\main\java\cn\sharesdk\onekeyshare\theme\classic\EditPage.java  
  2. Error:Error: Expected resource of type id [ResourceType]   

这是在有代码在设置资源ID时,直接写入整型数据而有的警告,eclipse中没事,但是AS打包不让通过
解决方案:
在AS的build.gradle中加入红色代码段就可以了,代表取消这些警告:


lintOptions {
    disable "ResourceType"
}

例如:
[cpp]  view plain  copy
  1. android {  
  2.     compileSdkVersion 23  
  3.     buildToolsVersion "23.0.3"  
  4.   
  5.     ......  
  6.   
  7.     lintOptions {  
  8.         disable "ResourceType"  
  9.     }  
  10. }  

猜你喜欢

转载自blog.csdn.net/dodod2012/article/details/80569187
今日推荐