You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What went wrong:
A problem occurred evaluating project ':react-native-picker'.
Could not find method compile() for arguments [directory 'libs'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
// monorepo workaround
// react-native can be hoisted or in project's own node_modules
def reactNativeFromProjectNodeModules = file("${rootProject.projectDir}/../node_modules/react-native")
if (reactNativeFromProjectNodeModules.exists()) {
return reactNativeFromProjectNodeModules
}
def reactNativeFromNodeModulesWithPicker = file("${projectDir}/../../../react-native")
if (reactNativeFromNodeModulesWithPicker.exists()) {
return reactNativeFromNodeModulesWithPicker
}
throw new Exception(
"[react-native-picker] Unable to resolve react-native location in " +
"node_modules. You should add project extension property (in app/build.gradle) " +
"`REACT_NATIVE_NODE_MODULES_DIR` with path to react-native."
)
def isNewArchitectureEnabled() {
// To opt-in for the New Architecture, you can either:
// - Set newArchEnabled to true inside the gradle.properties file
// - Invoke gradle with -newArchEnabled=true
// - Set an environment variable ORG_GRADLE_PROJECT_newArchEnabled=true
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
}
apply plugin: 'com.android.library'
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
When trying to create a development build using expo, I get this error:
✖ Build failed
🤖 Android build failed:
Gradle build failed with unknown error. See logs for the "Run gradlew" (https://expo.dev/accounts/danieljvargas/projects/Tesis/builds/38108ef5-955d-4d22-9845-429f2ce04d27#run-gradlew) phase for more information.
There I see:
FAILURE: Build failed with an exception.
Build file '/home/expo/workingdir/build/node_modules/react-native-picker/android/build.gradle' line: 25
A problem occurred evaluating project ':react-native-picker'.
The file in question being:
`buildscript {
ext.safeExtGet = {prop, fallback ->
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
repositories {
google()
mavenCentral()
}
}
def getExtOrDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['ReactNativePicker_' + name]
}
def getExtOrIntegerDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['ReactNativePicker_' + name]).toInteger()
}
def resolveReactNativeDirectory() {
def reactNativeLocation = safeExtGet("REACT_NATIVE_NODE_MODULES_DIR", null)
if (reactNativeLocation != null) {
return file(reactNativeLocation)
}
}
def getReactNativeMinorVersion() {
def REACT_NATIVE_DIR = resolveReactNativeDirectory()
}
def isNewArchitectureEnabled() {
// To opt-in for the New Architecture, you can either:
// - Set
newArchEnabled
to true inside thegradle.properties
file// - Invoke gradle with
-newArchEnabled=true
// - Set an environment variable
ORG_GRADLE_PROJECT_newArchEnabled=true
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
}
apply plugin: 'com.android.library'
if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
android {
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
namespace "com.reactnativecommunity.picker"
}
compileSdkVersion safeExtGet('compileSdkVersion', 31)
}
repositories {
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$projectDir/../node_modules/react-native/android"
}
google()
mavenCentral()
}
dependencies {
if (isNewArchitectureEnabled() && getReactNativeMinorVersion() < 71) {
implementation project(":ReactAndroid")
} else {
implementation 'com.facebook.react:react-native:+'
}
}`
I dont see what is the problem in line 25
The text was updated successfully, but these errors were encountered: