build.gradle - Error building release flavor for Android application -
i'm studying basics of build types , trying create release , debug flavors app. firstly, i've created directory config in root folder of app. generated signed apk key , set path config directory. made following changes in build.gradle. following build.gradle file.
apply plugin: 'com.android.application' android { compilesdkversion 25 buildtoolsversion "26.0.0" defaultconfig { applicationid "com.example.sarthak.chitchatmessagingapp" minsdkversion 21 targetsdkversion 25 versioncode 1 versionname "1.0" testinstrumentationrunner "android.support.test.runner.androidjunitrunner" } signingconfigs { chitchatreleaseconfig { storefile file("../config/releaseapkkey.jks"); storepassword("123456"); keyalias("releaseapkkey"); keypassword("123456"); } } buildtypes { debug { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } release { minifyenabled true zipalignenabled true proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' signingconfig signingconfigs.chitchatreleaseconfig } releasedebug { debuggable true minifyenabled true zipalignenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' signingconfig signingconfigs.chitchatreleaseconfig } } } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) androidtestcompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:25.3.1' compile 'com.android.support:design:25.3.1' compile 'com.google.firebase:firebase-auth:10.0.1' compile 'com.google.firebase:firebase-database:10.0.1' compile 'com.google.firebase:firebase-storage:10.0.1' compile 'com.firebaseui:firebase-ui-database:1.1.1' compile 'de.hdodenhof:circleimageview:2.1.0' compile 'com.squareup.picasso:picasso:2.5.2' compile 'com.squareup.okhttp:okhttp:2.4.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.+' compile 'id.zelory:compressor:2.0.0' compile 'com.android.support.constraint:constraint-layout:1.0.2' compile 'com.google.firebase:firebase-messaging:10.0.1' testcompile 'junit:junit:4.12' } apply plugin: 'com.google.gms.google-services'
however, keep getting following error.
error:(25, 0) not find method release() arguments [build_ehqm3plmr2s7xq0x3e59oqqgt$_run_closure1$_closure5$_closure8@7595456a] on buildtype_decorated{name=debug, debuggable=true, testcoverageenabled=false, jnidebuggable=false, pseudolocalesenabled=false, renderscriptdebuggable=false, renderscriptoptimlevel=3, minifyenabled=false, zipalignenabled=true, signingconfig=signingconfig_decorated{name=debug, storefile=c:\users\sarthak\.android\debug.keystore, storepassword=android, keyalias=androiddebugkey, keypassword=android, storetype=c:\users\sarthak\.android\debug.keystore, v1signingenabled=true, v2signingenabled=true}, embedmicroapp=false, mbuildconfigfields={}, mresvalues={}, mproguardfiles=[c:\users\sarthak\documents\androidprojects\chitchat messaging app\build\intermediates\proguard-files\proguard-android.txt-2.3.2, c:\users\sarthak\documents\androidprojects\chitchat messaging app\app\proguard-rules.pro], mconsumerproguardfiles=[], mmanifestplaceholders={}} of type com.android.build.gradle.internal.dsl.buildtype.
can me figure out error about?
add newline before each buildtype:
buildtypes { debug { ... } release { ... } releasedebug { ... } }
that is, not put new buildtype on same line closing bracket of previous buildtype } release {
i able trigger problem in project using style. able fix putting in newline suggested. must have way gradle parsing.
Comments
Post a Comment