AndroidStudio compilation error: Access local variable xxx from an internal class; it needs to be declared as a final type.

(1) Question:

AndroidStudio compilation error: Access local variable xxx from an internal class; it needs to be declared as a final type.

 (2) Solution:

Add in build.gradle

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

Guess you like

Origin blog.csdn.net/weixin_46211609/article/details/129744572