找不到com.android.tools.build:gradle:2.3.+的任何匹配项 [英] Could not find any matches for com.android.tools.build:gradle:2.3.+

查看:415
本文介绍了找不到com.android.tools.build:gradle:2.3.+的任何匹配项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试通过react-native run-android构建我的应用程序时遇到此错误.昨天很好,但今天突然收到此错误.我尝试了任何解决方案,但仍然无法解决.

I'm getting this error in when I try to build my app through react-native run-android. It was fine yesterday, but suddenly get this error today. I try any solution but i'm still stuck.

我已经检查了react native矢量图标,看起来不错,这在iOS上也能很好地工作.

I already check the react native vector icons and it looks fine, this also working well with iOS.

这是错误

   * What went wrong:
A problem occurred configuring project ':react-native-vector-icons'.
> Could not resolve all files for configuration ':react-native-vector-icons:classpath'.
   > Could not find any matches for com.android.tools.build:gradle:2.3.+ as no versions of com.android.tools.build:gradle are available.
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/build/gradle/maven-metadata.xml
         https://jcenter.bintray.com/com/android/tools/build/gradle/
     Required by:
         project :react-native-vector-icons

这是我的gradle文件

Here's my gradle file

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
        google()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath 'com.google.gms:google-services:3.2.0'
        classpath 'io.fabric.tools:gradle:1.+'

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

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

ext {
    buildToolsVersion = "26.0.1"
    minSdkVersion = 16
    compileSdkVersion = 26
    targetSdkVersion = 26
    supportLibVersion = "26.1.0"
}

subprojects {

 project.configurations.all {
    resolutionStrategy.eachDependency { details ->
       if (details.requested.group == 'com.android.support'
              && !details.requested.name.contains('multidex') ) {
           details.useVersion "26.0.1"
        }
     }
  }

  afterEvaluate {project ->
      if (project.hasProperty("android")) {
          android {
              compileSdkVersion rootProject.ext.compileSdkVersion
              buildToolsVersion '26.0.1'
              defaultConfig {
                  targetSdkVersion rootProject.ext.targetSdkVersion
              }
          }
      }
  }
}

有人可以帮我这里想念的东西吗?非常感谢

could someone help what am i missing here? very much appreciated

推荐答案

基于此

android许可证.也许尝试$ ANDROID_HOME/tools/bin/sdkmanager"build-tools; 26.0.1""platforms; android-26",看看是否有帮助.

android licenses. Maybe try $ANDROID_HOME/tools/bin/sdkmanager "build-tools;26.0.1" "platforms;android-26" and see if that helps.

此图片可以为您提供帮助

This Image can help you

我建议您更新buildToolsVersionsupportLibVersion

这篇关于找不到com.android.tools.build:gradle:2.3.+的任何匹配项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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