nickbutcher / plaid

An Android app which provides design news & inspiration as well as being an example of implementing material design.
Apache License 2.0
16.25k stars 3.16k forks source link

Could not find method implementation() for arguments [com.android.support.constraint:constraint-layout:1.1.0-beta1] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. #207

Closed amlwin closed 7 years ago

amlwin commented 7 years ago

Hello I'm New to OSS

I'm using android studio 2.3.3 and getting error while I build Plaid

Error:(72, 0) Could not find method implementation() for arguments [com.android.support.constraint:constraint-layout:1.1.0-beta1] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

here are app level gradle

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

// query git for the SHA, Tag and commit count. Use these to automate versioning.
def gitSha = 'git rev-parse --short HEAD'.execute([], project.rootDir).text.trim()
def gitTag = 'git describe --tags'.execute([], project.rootDir).text.trim()
def gitCommitCount = 100 +
        Integer.parseInt('git rev-list --count HEAD'.execute([], project.rootDir).text.trim())

android {
    compileSdkVersion versions.compileSdk
    buildToolsVersion versions.buildTools

    defaultConfig {
        applicationId "io.plaidapp"
        minSdkVersion 21
        targetSdkVersion versions.targetSdk
        versionCode gitCommitCount
        versionName gitTag
        archivesBaseName = "plaid"
        resConfig "en"
        buildConfigField "String", "GIT_SHA", "\"${gitSha}\""
        buildConfigField "String", "DRIBBBLE_CLIENT_ID", "\"${dribbble_client_id}\""
        buildConfigField "String", "DRIBBBLE_CLIENT_SECRET", "\"${dribbble_client_secret}\""
        buildConfigField "String",
                "DRIBBBLE_CLIENT_ACCESS_TOKEN", "\"${dribbble_client_access_token}\""
        buildConfigField "String", "DESIGNER_NEWS_CLIENT_ID", "\"${designer_news_client_id}\""
        buildConfigField "String",
                "DESIGNER_NEWS_CLIENT_SECRET", "\"${designer_news_client_secret}\""
        buildConfigField "String",
                "PROCUCT_HUNT_DEVELOPER_TOKEN", "\"${product_hunt_developer_token}\""
        def filesAuthorityValue = applicationId + ".shareprovider"
        buildConfigField "String", "FILES_AUTHORITY", "\"${filesAuthorityValue}\""
        manifestPlaceholders = [filesAuthority: filesAuthorityValue]
    }
    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
}

repositories {
    jcenter()
    google()
}

dependencies {
    implementation 'com.android.support.constraint:constraint-layout:1.1.0-beta1'
    implementation "com.android.support:customtabs:${versions.supportLibrary}"
    implementation "com.android.support:design:${versions.supportLibrary}"
    implementation "com.android.support:palette-v7:${versions.supportLibrary}"
    implementation "com.android.support:recyclerview-v7:${versions.supportLibrary}"
    implementation "com.android.support:support-dynamic-animation:${versions.supportLibrary}"
    implementation 'com.github.bumptech.glide:glide:3.8.0'
    implementation 'com.github.bumptech.glide:okhttp3-integration:1.5.0@aar'
    implementation 'com.google.code.gson:gson:2.8.1'
    implementation "com.jakewharton:butterknife:${versions.butterknife}"
    annotationProcessor "com.jakewharton:butterknife-compiler:${versions.butterknife}"
    implementation "com.squareup.retrofit2:retrofit:${versions.retrofit}"
    implementation "com.squareup.retrofit2:converter-gson:${versions.retrofit}"
    implementation 'com.squareup.okhttp3:okhttp:3.8.1'
    implementation 'org.jsoup:jsoup:1.10.3'
    implementation project(':bypass')
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:${versions.kotlin_version}"
}

here are project level gradle

buildscript {

    ext.versions = [
            'compileSdk'    : 26,
            'targetSdk'     : 26,
            'buildTools'    : '26.0.1',
            'supportLibrary': '26.0.1',
            'retrofit'      : '2.3.0',
            'butterknife'   : '8.8.1',
            'kotlin_version': '1.1.3-2'
    ]

    repositories {
        jcenter()
        google()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin_version}"
    }

}
jarvanh commented 7 years ago

I use "compile" instead of "implementation".

image

nickbutcher commented 7 years ago

Sorry but you'll have to update to Android Studio 3 betas and Gradle 4.1 to build Plaid.

amlwin commented 7 years ago

@Jarvanh Thanks. it is solve by changing implementation to compile

amlwin commented 7 years ago

Thanks @nickbutcher too. I'm new to Open Source Software.If I have a chance I want to be part of contributors in Plaid.

nickbutcher commented 7 years ago

Welcome to Open Source! Look forward to seeing your contributions in the future.

GrowUpTang commented 5 years ago

gradle版本的问题,新版本用到api和implementation,这一点要注意。

vasantha780 commented 5 years ago
Gradle sync failed: Could not find method classpath() for arguments [com.google.gms:google-services:4.2.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
        Consult IDE log for more details (Help | Show Log) (7 s 458 ms)

I recently started project in android studio. can anyone tell me please how to solve above error.im getting sync failed.

HamzaBula commented 2 years ago
Gradle sync failed: Could not find method classpath() for arguments [com.google.gms:google-services:4.2.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
      Consult IDE log for more details (Help | Show Log) (7 s 458 ms)

I recently started project in android studio. can anyone tell me please how to solve above error.im getting sync failed.

did you find the solution?