Android Studio "diamond operator is not supported" 处理方法

低版本的android编译环境是不支持使用java7语法的,如果使用了,就会产生上述问题,如果你的android环境较新,那么可以使用以下方法:

在build.gradle的android标签下加入以下代码

 compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
原文地址:https://www.cnblogs.com/breezemist/p/3858337.html