gpt4 book ai didi

android - react-native run-android 找不到 com.android.tools.build :gradle:3. 0.1

转载 作者:IT老高 更新时间:2023-10-28 21:44:34 26 4
gpt4 key购买 nike

apple@mosesdeMacBook-Pro:~/Desktop/sxtbdemo2$ react-native run-android
Scanning folders for symlinks in /Users/apple/Desktop/sxtbdemo2/node_modules (8ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...

FAILURE: Build failed with an exception.

What went wrong:
A problem occurred configuring root project 'sxtbdemo2'.
Could not resolve all files for configuration ':classpath'.
Could not find com.android.tools.build:gradle:3.0.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.jar
Required by:
project :

Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org

BUILD FAILED in 12s
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/android-setup.html

最佳答案

这通常是您的 gradle 文件中的存储库有问题。

对我来说,像这样修改 build.gradle:

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

所以当你添加 google() 时它应该可以工作。

关于android - react-native run-android 找不到 com.android.tools.build :gradle:3. 0.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47446681/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com