0

Updated my android studio to 0.5.1 just now and facing so many issues:

This is my build.gradle file:

buildscript {
repositories {
    maven { url 'http://download.crashlytics.com/maven' }
    }

    dependencies {
    }
}
apply plugin: 'android'
repositories {
    maven { url 'http://download.crashlytics.com/maven' }
}


android {
compileSdkVersion 19
buildToolsVersion '19.0.3'

defaultConfig {
    minSdkVersion 14
    targetSdkVersion 19
    versionCode 1
    versionName "1.0"
}

signingConfigs {
    release {
        storeFile file('dsc.jks')
        storePassword 'dscneo'
        keyAlias 'dsc'
        keyPassword 'dscneo'
    }
}

buildTypes {
    debug {
        versionNameSuffix '-DEBUG'
    }
    beta {
        versionNameSuffix '-BETA'
    }
    release {
        runProguard false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        signingConfig signingConfigs.release
    }
}

packagingOptions {
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/ASL2.0'
    }
}
dependencies {
    compile 'com.android.support:appcompat-v7:+'
    compile files('libs/gson-2.2.4.jar')
    compile files('libs/gson-2.2.4-sources.jar')
    compile files('libs/volley.jar')
    compile files('libs/gson-2.2.4-javadoc.jar')
    compile project(':HorizontalVariableListView')
    compile files('libs/sugar-1.2.jar')
    compile 'com.crashlytics.android:crashlytics:1.+'
    compile project(':shopify_view_pager')
    compile project(':shopify_smoothProgressBar_library')
    compile files('libs/butterknife-4.0.1.jar')
    compile project(':shopify_sliding_pane_library')
}

This is the error that is prompted:

Gradle 'shopping-app-android' project refresh failed:
         Build script error, unsupported Gradle DSL method found: 'release()'!
         Possible causes could be:  
         - you are using Gradle version where the method is absent 
         - you didn't apply Gradle plugin which provides the method
         - or there is a mistake in a build script

Please help!

I have just started using Android Studio.

AabidMulani
  • 2,325
  • 1
  • 28
  • 47

1 Answers1

0

It seems like you're still running gradle plugin 0.8. See Migrating From 0.8 to 0.9

  • My build.gradle of the project has **classpath 'com.android.tools.build:gradle:0.9.+'** – AabidMulani Mar 14 '14 at 08:57
  • Have you see this thread? [Force Android Studio to download and install gradle 1.10 or 1.1](http://stackoverflow.com/questions/22359831/force-android-studio-to-download-and-install-gradle-1-10-or-1-1?rq=1) – Mitch Wong Ho Mar 14 '14 at 09:04
  • the log was prompting issue in release() declaration. So i removed all the release declaration and its working now. – AabidMulani Mar 14 '14 at 09:19
  • I had problems when I first installed 5.1 also. One of the things I did was upgrade gradle to version 1.11. Not sure if this was required but I'm finding that it seems important in Android Studio to make sure I'm using the most current Android Gradle plugin and the corresponding Gradle version. – AndroidGuy Mar 14 '14 at 14:40