2

I am using RN 0.55.4 react-native-fbsdk 0.8.0

There is a build error

  • Where: Build file 'C:\Users\WOT\fdrrnc\node_modules\react-native-fbsdk\android\build.gradle' line: 30

  • What went wrong: A problem occurred evaluating project ':react-native-fbsdk'. Could not find method implementation() for arguments [com.android.support:appcompat-v7:27.0.2] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

This my gradle on android/build.gradle

dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
    }

Anyone know whats wrong?

2 Answers 2

3

In case anyone is still looking for this, here's what I did based on the answers from Pritish for this question and similar ones.

Make sure you are using the compatible version of gradle

Update android/gradle/wrapper/gradle-wrapper.properties

distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

Update android/build.gradle classpath

classpath 'com.android.tools.build:gradle:3.1.2'

Add maven google url

Update android/build.gradle (both buildscript and allprojects)

buildscript {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
    ...
}

allprojects {
    repositories {
        mavenLocal()
        jcenter()
        maven {
            url "$rootDir/../node_modules/react-native/android"
        }
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
}

Check that you are using at least API 26

If you are using an older react native version prior to the changes where they updated to use API 26, check these values in your android/app/build.gradle file:

compileSdkVersion 26
buildToolsVersion "26.0.3"

defaultConfig {
    ...
    targetSdkVersion 26
    ...
}
0

Your gradle version needs to be version 3.0 or higher in order to use implementation.

Therefore you need to upgrade it.

build.gradle (project level)

dependencies {
   classpath 'com.android.tools.build:gradle:3.x.x'
}

gradle wrapper-properties

distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
3
  • Could not resolve all files for configuration ':classpath'. > Could not find com.android.tools.build:gradle:3.0.1. Searched in the following locations: jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/… jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/… Required by: project :
    – Tom Kur
    Commented Sep 12, 2018 at 14:57
  • Task :app:processDebugResources FAILED Failed to execute aapt com.android.ide.common.process.ProcessException: Failed to execute aapt
    – Tom Kur
    Commented Sep 12, 2018 at 15:17
  • This would be the generalised error, you might need to update your compileSdkVersion buildToolsVersion as well. Not sure about that but try checking other solutions posted for that error. Commented Sep 12, 2018 at 16:01

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.