Lint found errors in the project; aborting build导致打包停止错误解决

Lint found errors in the project; aborting build导致打包停止错误解决

Laughing
2020-12-13 / 0 评论 / 2,592 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于2024年03月18日,已超过305天没有更新,若内容或图片失效,请留言反馈。

今天在打包时的时候出现了这个错导致打包不成功,具体原因可以从报错日志中看到是因为studio检测到了lint错误,从而停止了打包。
解决办法是在app下的build.gradle 文件的android节点下添加lintOptions{ abortOnError false }即可,即在检测到lint错误时还接续进行打包。

7:00:55 :app:lint FAILED
17:00:55 
17:00:55 FAILURE: Build failed with an exception.
17:00:55 
17:00:55 * What went wrong:
17:00:55 Execution failed for task ':app:lint'.
17:00:55 > Lint found errors in the project; aborting build.
17:00:55   
17:00:55   Fix the issues identified by lint, or add the following to your build script to proceed with errors:
17:00:55   ...
17:00:55   android {
17:00:55       lintOptions {
17:00:55           abortOnError false
17:00:55       }
17:00:55   }
17:00:55   ...
17:00:55   
17:00:55   The first 3 errors (out of 6) were:
17:00:55   /root/.gradle/caches/modules-2/files-2.1/com.alibaba/fastjson/1.2.35/d0b54f814af4652f0893d560d6a785917abdeae1/fastjson-1.2.35.jar: Error: Invalid package reference in library; not included in Android: java.awt. Referenced from com.alibaba.fastjson.serializer.AwtCodec. [InvalidPackage]
17:00:55   /root/.gradle/caches/modules-2/files-2.1/com.alibaba/fastjson/1.2.35/d0b54f814af4652f0893d560d6a785917abdeae1/fastjson-1.2.35.jar: Error: Invalid package reference in library; not included in Android: javax.servlet.http. Referenced from com.alibaba.fastjson.support.spring.FastJsonJsonView. [InvalidPackage]
17:00:55   /root/.gradle/caches/modules-2/files-2.1/com.alibaba/fastjson/1.2.35/d0b54f814af4652f0893d560d6a785917abdeae1/fastjson-1.2.35.jar: Error: Invalid package reference in library; not included in Android: javax.servlet. Referenced from com.alibaba.fastjson.support.spring.FastJsonJsonView. [InvalidPackage]
3

评论 (0)

取消
  1. 头像
    CiXY
    MacOS · Safari

    谢谢

    回复