【发布时间】:2023-03-12 20:01:01
【问题描述】:
添加 react-native-image-crop-picker 后,我正在构建我的项目。但我遇到了这个错误。 你能告诉我解决这个问题的方法吗?非常感谢。
//build.gradle
buildscript {
ext {
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
ndkVersion = "20.1.5948944"
}
repositories {
mavenCentral()
google()
}
dependencies {
classpath("com.android.tools.build:gradle:4.2.1")
}
}
allprojects {
repositories {
mavenCentral()
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
google()
maven { url 'https://maven.google.com' }
maven { url 'https://www.jitpack.io' }
}
}
【问题讨论】:
-
jcenter 消息不是错误消息,它只是一个警告,说您应该考虑删除 jcenter 并使用 maven。您要查找的错误消息出现在
* What went wrong:之后。在你的情况下,这个答案应该可以解决你的问题:NDK at ~/Library/Android/sdk/ndk-bundle did not have a source.properties file -
这是一个有用的链接,它将提供解决此问题的替代解决方案。 blog.gradle.org/jcenter-shutdown
标签: android react-native maven build.gradle jcenter