您的位置:首页 > 移动开发 > Android开发

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

2017-03-01 12:58 543 查看
AS打包经常会报这样的错误,特别是在使用SharedSDK时:

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


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

lintOptions {
disable "ResourceType"
}


例如:
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"

......

lintOptions {
disable "ResourceType"
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐