kautilya hari
kautilya hari

Reputation: 213

Could not find property 'androidTestCompile'

I'm trying to add a google sign-in option using the firebase console to my app. So I have downloaded the app samples and tired to run, then after coming through various errors and rectifying them I'm stuck at this point please help

Error:(80, 0) Could not find property 'androidTestCompile' on org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler_Decorated@39a8aa.

This is my gradle code:

 apply plugin: 'com.android.application'

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.1.2'
}
} 

 allprojects {
repositories {
    jcenter()
}
}

android {
compileSdkVersion 24
buildToolsVersion "24.0.0"

defaultConfig {
    applicationId "com.google.firebase.quickstart.auth"
    minSdkVersion 9
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
}

buildTypes {
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

productFlavors {

    // Build variant to include the Facebook Android SDk
    // The Facebook Android SDK has a min SDK version of 15
    facebook {
        minSdkVersion 15
    }

    // Build variant to exclude the Facebook Android SDK
    // Firebase Authentication has a min SDK version of 9
    nofacebook {
        minSdkVersion 9
    }

}
}

 configurations.all {
resolutionStrategy.force 'com.android.support:support-annotations:24.0.0'
}

dependencies {


// Firebase Authentication

// Google Sign In SDK (only required for Google Sign In)

// Facebook Android SDK (only required for Facebook Login)
// This is only compiled into the 'facebook' variant of this app. You can build
// a 'nofacebook' variant to test on devices with SDK < 15.
facebookCompile 'com.facebook.android:facebook-android-sdk:4.9.0'

// Twitter Android SDK (only required for Twitter Login)
compile('com.twitter.sdk.android:twitter-core:1.6.6@aar') {
    transitive = true
}
compile('com.twitter.sdk.android:twitter:1.13.1@aar') {
    transitive = true;
}

androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestCompile
'com.android.support.test:runner:0.5'
compile
'com.android.support:appcompat-v7:24.1.1'compile
'com.google.firebase:firebase-auth:9.2.1'compile
'com.google.android.gms:play-services-auth:9.2.1'}

apply plugin: 'com.google.gms.google-services'

Upvotes: 1

Views: 378

Answers (1)

Divers
Divers

Reputation: 9569

Format your build.gradle in a normal way:

apply plugin: 'com.android.application'

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.2'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.0"

    defaultConfig {
        applicationId "com.google.firebase.quickstart.auth"
        minSdkVersion 9
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    productFlavors {

        // Build variant to include the Facebook Android SDk
        // The Facebook Android SDK has a min SDK version of 15
        facebook {
            minSdkVersion 15
        }

        // Build variant to exclude the Facebook Android SDK
        // Firebase Authentication has a min SDK version of 9
        nofacebook {
            minSdkVersion 9
        }

    }
}

configurations.all {
    resolutionStrategy.force 'com.android.support:support-annotations:24.0.0'
}

dependencies {

// Firebase Authentication

// Google Sign In SDK (only required for Google Sign In)

// Facebook Android SDK (only required for Facebook Login)
// This is only compiled into the 'facebook' variant of this app. You can build
// a 'nofacebook' variant to test on devices with SDK < 15.
    facebookCompile 'com.facebook.android:facebook-android-sdk:4.9.0'

// Twitter Android SDK (only required for Twitter Login)
    compile('com.twitter.sdk.android:twitter-core:1.6.6@aar') {
        transitive = true
    }
    compile('com.twitter.sdk.android:twitter:1.13.1@aar') {
        transitive = true;
    }

    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
    androidTestCompile 'com.android.support.test:runner:0.5'
    compile 'com.android.support:appcompat-v7:24.1.1'
    compile 'com.google.firebase:firebase-auth:9.2.1'
    compile 'com.google.android.gms:play-services-auth:9.2.1'
}

apply plugin: 'com.google.gms.google-services'

There is a hot key in Android Dev Studio for autoformatting - ALT + CMD + L

Upvotes: 1

Related Questions