gradlew build是Lint出现问题

  • 在windows下gradlew build安卓项目时出现问题

    • What went wrong:
      Execution failed for task ':app:lint'.

    Lint found errors in the project; aborting build.

    Fix the issues identified by lint, or add the following to your build script to
    proceed with errors:
    android {
    lintOptions {
    abortOnError false

    • Try:
      Run with --stacktrace option to get the stack trace. Run with --info or --debug
      option to get more log output.

  • React Native for Android的依赖库okio不能通过lint检测,因此需要添加例外。


    <?xml version="1.0" encoding="UTF-8"?>  
        <issue id="InvalidPackage">  
            <ignore regexp="okio-1.5.0.jar" />  

    或者直接下载lint.xml 放到/android/app/下并改名为lint.xml,问题即解决。

  • 完全解决了我的问题,实在是太厉害了,十分感谢

  • 我建议新手直接关掉lint,先想办法实现,再考虑优化