本文介绍了Gradle 构建完成,出现 200 个错误 - 在 android studio 中更改限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

主要问题

主要问题仍未解决:有没有办法更改android studio中打印到控制台的限制?

旧内容

我正在使用代码生成库.因此,一个错误可能会突然导致数百个错误,从而导致这个错误.

I'm using code generation libraries. So a single error can suddenly lead to hundreds of errors resulting in this single error.

目前我遇到了找不到错误的问题,因为我收到了 200 个 error: cannot find symbol class ......

Currently I've the problem that I can't find the error, as I get 200 errors of error: cannot find symbol class ......

如何将 200 的限制更改为更大的数字?

How can I change the limit of 200 to a bigger number?

编辑

没有代码,因为这是一个android studio问题

No code, as it is a android studio question

EDIT2

我知道,如果我打开一个 xml 文件并插入一些无效代码(偶然),就会发生这种情况.它只是偶然发生......问题是,android studio 在实际错误源可见之前停止将错误写入错误输出控制台......

I know, it can happen if I open a xml file and insert some invalid code (by accident). It just happens by accident... The problem is, that android studio stops writing the errors to the error output console before the actual error source is visible...

我的问题的解决方案

在我的特殊情况下,我向类添加了一个字段并将其声明为私有.这导致问题,parcelable 的代码生成器失败.它打印了一个错误,但由于 200 个错误的限制而无法看到...

In my special case I added a field to class and declared it as private. This lead to the problem, that the code generator for parcelable failed. It prints an error, but it can't be seen due to the 200 errors limit...

推荐答案

将此添加到您的 Build.gradle

Add this to your Build.gradle

allprojects {
  gradle.projectsEvaluated {
    tasks.withType(JavaCompile) {
        options.compilerArgs << "-Xmaxerrs" << "1000"
    }
  }
}

这篇关于Gradle 构建完成,出现 200 个错误 - 在 android studio 中更改限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 18:53