How to let AndroidStudio show all compile errors at once?

冷暖自知 提交于 2020-01-13 08:51:08

问题


Reluctantly I turned from Eclipse to AndroidStudio for developing apps (only for that). What is really annoying to me is that AndroidStudio does not show all compile errors at once or I haven't found the right option till now.

Given these stupid classes first everything is fine:

A.kt

package so

class A(val a: Int) {

    fun add(b: Int): Int {
        return a + b
    }
}

B.kt

package so

class B {

    fun foo() {
        val a = A(1)
        val c = a.add(2)
    }
}

C.kt

package so

class C {

    fun bar() {
        val a = A(3)
        val c = a.add(4)
    }
}

Now, if I'm in A and by mistake remove a letter from method name add so its name becomes ad. Then, no error is shown in B or C:

Neither Build > Make Project nor Build > Rebuild Project mark the errorneous classes though they are listed in the compile log:

Only if opening B or C in the editor the buggy class are underlined in red.

Sometimes I detect syntax errors a long while after changing some code at another place.

Is there any solution for this, any option I have overseen?


回答1:


That's a known issue. Some versions of Kotlin hide build errors in some releases of Android Studio. Thus, Android Studio frustratingly doesn't display them in the Messages tab. But you can still find all the errors – you have to open the Gradle Console to get to them.

Hope this will be fixed in a future releases of AS.



来源:https://stackoverflow.com/questions/49835192/how-to-let-androidstudio-show-all-compile-errors-at-once

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!