Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

diamond operator is not supported [duplicate]

I am trying to use the diamond operator, but I am getting the following message:

diamond operator is not supported in -source 1.5 (use -source 7 or higher to enable diamond operator)

Is it fixable in netbeans with android?

like image 929
Get Off My Lawn Avatar asked Jan 23 '13 19:01

Get Off My Lawn


1 Answers

API 19 KitKat Diamonds are now allowed. Below are Gradle edits needed to implement for Android Studio. Also make sure you are using JDK 1.7 and Gradle plugin later than 0.6.1

android {
compileSdkVersion 19
buildToolsVersion "19.0.0"

defaultConfig {
    minSdkVersion 7
    targetSdkVersion 19
}

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_7
    targetCompatibility JavaVersion.VERSION_1_7
}
}
like image 177
Ryan Heitner Avatar answered Oct 24 '22 03:10

Ryan Heitner