当我尝试通过react-native run-android构建我的应用程序时,我收到此错误.昨天很好,但今天突然收到这个错误.我尝试任何解决方案,但我仍然卡住了.
我已经检查了反应原生矢量图标,它看起来很好,这也适用于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文件
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
}
}
}
}
}
有人可以帮助我在这里失踪吗?非常感谢
解决方法:
基于此link
android licenses. Maybe try $ANDROID_HOME/tools/bin/@R_710_5025@ager “build-tools;26.0.1” “platforms;android-26” and see if that helps.
这张图片可以帮到你
我建议你更新buildToolsversion和supportLibVersion
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。