Reputation: 45
I tried to run my app and got this erro, help me please.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
android {
signingConfigs {
config {
}
}
buildToolsVersion '24.0.2'
compileSdkVersion 24
buildTypes {
buildType {
signingConfig signingConfigs.config
}
}
}
dependencies {
}
ERROR:
Error:(22, 0) Could not find method android() for arguments [build_exkifxt5bplscorlvh4v3btv2$_run_closure3@981984c] on root project 'Recipe App' of type org.gradle.api.Project.
Upvotes: 0
Views: 2368
Reputation: 807
Add this line:
apply plugin: 'com.android.feature'
To the top of the problematic build.gradle file and sync again.
Upvotes: 1
Reputation: 36
I faced same problem and SOLVED IT BY:
for more details here
Upvotes: 0
Reputation: 1
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
dexOptions {
incremental true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
compile files('app/libs/junit-4.12-JavaDoc.jar')
}
apply plugin: 'maven'`enter code here`
Upvotes: 0