在RN开发过程中,执行react-native run-android
命令之后,报如下错信息:
Error:Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'
解决措施
在项目的build.gradle
文件buildscript
和 allprojects
节点同时加上 mavenCentral() google()
即可。
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
mavenCentral()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
web前端开发工程师面试题(react)
在UE开发开发过程中,安卓打包,报如下错信息:
Error:Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'