Android : Errors while porting project to Android Studio?

on Saturday, March 28, 2015


I'm new to Android Studio, I've been using Eclipse for about 2 years. I've trying understanding these solutions.


Android gradle build Error:(9, 0) Gradle DSL method not found: 'compile()'.


Gradle DSL method not found: 'compile()'


I just can't get it to work.


Here's what it says..


Error:(17, 0) Gradle DSL method not found: 'compile()' Possible causes:



  • The project 'clxxxii - PMv5' may be using a version of Gradle that does not contain the method. Open Gradle wrapper file

  • The build file may be missing a Gradle plugin. Apply Gradle plugin


Here's the file where it's giving an error



// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0' }
}

allprojects {
repositories {
mavenCentral()
}
}
dependencies {
apply plugin: 'announce'
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.android.support:cardview-v7:21.0.+'
}


And based on the other questions, you may need this too.



apply plugin: 'android'

android {
compileSdkVersion 17
buildToolsVersion "19.0.3"

defaultConfig {
minSdkVersion 8
targetSdkVersion 19
}

buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}

dependencies {
compile 'com.android.support:support-v4:+'
compile files('libs/FlurryAnalytics_3.3.0.jar')
compile files('libs/heyzap-ads-sdk.jar')
compile files('libs/HomeBaseSDK2.2.jar')
compile files('libs/placed-persistent-sdk-1.10.jar')
compile files('libs/revmob-6.7.0.jar')
}


Can someone help me understand what the problem is, and why it's happening?


0 comments:

Post a Comment