android - Gradle: 'buildTypes' cannot be applied to groovy.lang.Closure -


this question has answer here:

after changing targetsdkversion , compilesdkversion 22, , changing buildtoolsversion 22.0.1, keep getting following error:

'buildtypes' cannot applied '(groovy.lang.closure< com.android.build.gradle.internal.dsl.buildtype>)'

i looked @ build.gradle file , tried error:

apply plugin: 'com.android.application'  android {     compilesdkversion 22     buildtoolsversion "22.0.1"      defaultconfig {         applicationid "********"         minsdkversion 14         targetsdkversion 22         versioncode 17         versionname "1.5-beta"     }     buildtypes {         release {             minifyenabled true             proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro'         }     }     productflavors {         freeflavour {             applicationid "********"         }         paidflavour {             applicationid "********"         }     } }  dependencies {     compile filetree(dir: 'libs', include: ['*.jar'])     compile 'com.android.support:appcompat-v7:22.0.0'     compile 'com.google.android.gms:play-services:7.0.0' } 

answer:

for reason, found cutting (ctrl + x) buildtypes section , pasting below productflavours section, moving seemed solve issue.


Popular posts from this blog