响应本机fbsdk生成错误找不到方法Implementation() [英] React native fbsdk build error Could not find method implementation()

查看:87
本文介绍了响应本机fbsdk生成错误找不到方法Implementation()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用RN 0.55.4
react-native-fbsdk 0.8.0

I am using RN 0.55.4 react-native-fbsdk 0.8.0

存在构建错误



  • 其中:构建文件'C:\Users\WOT\fdrrnc\node_modules\react-native-fbsdk \android\build.gradle'
    行:30

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

出了什么问题:评估项目':react-native-fbsdk时出现问题'。
在类型为
的对象org.gradle.api.internal.artifacts.dsl.dependencies的对象上找不到参数[com.android.support:appcompat-v7:27.0.2]的方法实现()。 DefaultDependencyHandler。

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.

这是我在 android / build上的成就.gradle

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

有人知道怎么了吗?

推荐答案

如果有人仍然在寻找这个,这是我根据Pritish对这个问题和类似问题的回答所做的。

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.

更新 android / gradle / wrapper / gradle-wrapper.properties

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

更新 android / build.grad le classpath

Update android/build.gradle classpath

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



添加maven谷歌网址



更新 android / build.gradle (包括buildscript和所有项目)

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'
        }
    }
}



检查您是否至少使用了API 26



如果您使用的是较早的react本地版本,则在更改之前要使用API​​ 26,请在您的 android / app / build.gradle 文件中检查以下值:

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
    ...
}

这篇关于响应本机fbsdk生成错误找不到方法Implementation()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆