Reputation: 15
I am using firebase for my android studio application. However I am stuck on this problem and I have tried everything possible to figure it out but I am unable to. Please help.
This is the error:
Gradle sync failed: Could not find method classpath() for arguments [com.android.tools.build:gradle:2.3.3] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Top-level gradle.build code
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
The other gradle code:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.mobility.mobilityindia"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
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'
})
String googleSupportVersion = '25.3.1'
String googlePlayServicesVersion = '11.0.2'
compile "com.google.firebase:firebase-core:$googlePlayServicesVersion"
compile "com.google.firebase:firebase-auth:$googlePlayServicesVersion"
compile "com.android.support:appcompat-v7:$googleSupportVersion"
compile "com.android.support:support-v4:$googleSupportVersion"
compile "com.google.android.gms:play-services:$googlePlayServicesVersion"
compile "com.android.support:design:$googleSupportVersion"
compile 'com.android.support.constraint:constraint-layout:1.0.2'
}
apply plugin: 'com.google.gms.google-services'
Upvotes: 2
Views: 1284
Reputation: 20140
Remove these two from your android level build.gradle
file
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3' <-- 1.
classpath 'com.google.gms:google-services:3.1.0' <-- 2.
...
...
}
Upvotes: 2