AndroidStudio编译出错:从内部类中访问本地变量xxx;需要被声明为最终类型。

(一)问题:

AndroidStudio编译出错:从内部类中访问本地变量xxx;需要被声明为最终类型。

 (二)解决方法:

在build.gradle中加入

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

猜你喜欢

转载自blog.csdn.net/weixin_46211609/article/details/129744572