React native 未配置本机映像选择器

React native 未配置本机映像选择器,react-native,react-native-image-picker,React Native,React Native Image Picker,我正在尝试安装到我的React本机项目,我已经按照文档建议进行了配置;如例子所示;我尝试重新安装Android Studio(3.1和3.2);我下载所有API和所有工具;没有什么能解决问题: Starting JS server... Building and installing the app on the device (cd android && ./gradlew installDebug)... > Configure project :app WARNI

我正在尝试安装到我的React本机项目,我已经按照文档建议进行了配置;如例子所示;我尝试重新安装Android Studio(3.1和3.2);我下载所有API和所有工具;没有什么能解决问题:

Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...

> Configure project :app 
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html


FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':react-native-image-picker'.
> Could not resolve all files for configuration ':react-native-image-picker:classpath'.
   > Could not find com.android.tools:common:25.2.3.
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/common/25.2.3/common-25.2.3.pom
         https://jcenter.bintray.com/com/android/tools/common/25.2.3/common-25.2.3.jar
     Required by:
         project :react-native-image-picker > com.android.tools.build:gradle:2.2.3 > com.android.tools.build:gradle-core:2.2.3 > com.android.tools.build:builder:2.2.3
         project :react-native-image-picker > com.android.tools.build:gradle:2.2.3 > com.android.tools.build:gradle-core:2.2.3 > com.android.tools.build:builder:2.2.3 > com.android.tools.build:manifest-merger:25.2.3
         project :react-native-image-picker > com.android.tools.build:gradle:2.2.3 > com.android.tools.build:gradle-core:2.2.3 > com.android.tools.build:builder:2.2.3 > com.android.tools.ddms:ddmlib:25.2.3
         project :react-native-image-picker > com.android.tools.build:gradle:2.2.3 > com.android.tools.build:gradle-core:2.2.3 > com.android.tools.build:builder:2.2.3 > com.android.tools.analytics-library:shared:25.2.3
         project :react-native-image-picker > com.android.tools.build:gradle:2.2.3 > com.android.tools.build:gradle-core:2.2.3 > com.android.tools.build:builder:2.2.3 > com.android.tools.analytics-library:tracker:25.2.3
         project :react-native-image-picker > com.android.tools.build:gradle:2.2.3 > com.android.tools.build:gradle-core:2.2.3 > com.android.tools.build:builder:2.2.3 > com.android.tools:sdklib:25.2.3 > com.android.tools.layoutlib:layoutlib-api:25.2.3
         project :react-native-image-picker > com.android.tools.build:gradle:2.2.3 > com.android.tools.build:gradle-core:2.2.3 > com.android.tools.build:builder:2.2.3 > com.android.tools:sdklib:25.2.3 > com.android.tools:dvlib:25.2.3
         project :react-native-image-picker > com.android.tools.build:gradle:2.2.3 > com.android.tools.build:gradle-core:2.2.3 > com.android.tools.build:builder:2.2.3 > com.android.tools:sdklib:25.2.3 > com.android.tools:repository:25.2.3

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 9s
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
My package.json:

{
  "name": "MyTestApp",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "moment": "^2.22.2",
    "react": "16.6.1",
    "react-native": "0.57.5",
    "react-native-datepicker": "^1.7.2",
    "react-native-image-picker": "^0.27.1",
    "react-native-loading-spinner-overlay": "^1.0.1",
    "react-native-picker-select": "^5.1.0",
    "react-navigation": "^2.18.2"
  },
  "devDependencies": {
    "babel-jest": "23.6.0",
    "jest": "23.6.0",
    "metro-react-native-babel-preset": "0.49.2",
    "react-test-renderer": "16.6.1"
  },
  "jest": {
    "preset": "react-native"
  }
}
出什么事了

更新

我的身材,格拉德尔

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

buildscript {
    ext {
        buildToolsVersion = "27.0.3"
        minSdkVersion = 16
        compileSdkVersion = 27
        targetSdkVersion = 26
        supportLibVersion = "27.1.1"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'

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

allprojects {
    repositories {
        mavenLocal()
        google()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
    }
}


task wrapper(type: Wrapper) {
    gradleVersion = '4.4'
    distributionUrl = distributionUrl.replace("bin", "all")
}

Android软件包有自己的构建工具依赖项,这可能会导致类似这样的错误。最好的解决方案是修改您的
android/build.gradle
android/app/build.gradle
以覆盖子项目,从而使用与应用程序使用的构建工具相同的构建工具

android/build.gradle android/app/build.gradle
升级到最新版本的
react native image picker
0.27.2
)似乎可以解决此问题

Update your all node module package which getting error like "react-native-image-picker" 
open this android project in android studio and update
gradle in individual-individual

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

这将对你有所帮助。

你能提供你的
android/build.gradle
android/app/build.gradle
文件吗?刚刚更新了@AnonymoussSBOK,我想我知道这个问题,我会在下面提供答案。大家好,更新你的所有节点模块包,会出现“react native image picker”之类的错误在android studio中打开此android Projection并在individual-individual中更新gradle。太棒了!谢谢!我花了三天找它!
android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    ... whatever else you have here ...
}
Update your all node module package which getting error like "react-native-image-picker" 
open this android project in android studio and update
gradle in individual-individual

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