反应原生相机Gradle sync失败:无法在存储库容器上找到方法google()for arguments []

Gre*_*gle 10 android gradle react-native react-native-camera react-native-android

我正在尝试安装react-native-camera.

我做到了npm install react-native-camera react-native link react-native-camera.

它给了我错误的说法Gradle sync failed: Could not find method google() for arguments [] on repository container.

我也尝试了手动链接,如文档中所述,直到我添加的第6步

allprojects {
    repositories {
        maven { url "https://jitpack.io" }
        maven { url "https://maven.google.com" }
    }
}
Run Code Online (Sandbox Code Playgroud)

我使用的是exifinterface版本,例如27. +而不是25. +

我有distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zipdistributionUrl和classpath 'com.android.tools.build:gradle:2.2.3'

我不知道我错过了什么.当我打开我的Android工作室时,它给了我错误Gradle sync failed: Could not find method google() for arguments [] on repository container

当我react-native run-android在手机上运行时,它给了我错误的说法undefined is not an object (evaluating 'cameramanager.aspect')

任何人都可以帮助我,我在这里失踪了什么?

这是我的傻瓜

// Top-level build file where you can add configuration options common to all sub-projects/modules.

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

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        maven { url "https://jitpack.io" }
        maven { url "https://maven.google.com" }
        mavenLocal()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

Art*_*out 2

将您的gradle-wrapper分发网址更改为

distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
Run Code Online (Sandbox Code Playgroud)