Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

474
Views
No se puede agregar la tarea 'envoltura' porque ya existe una tarea con ese nombre

Al instalar 'react-native init AwesomeProject' aparece este error cuando ejecuto react-native run-android :

 Could not determine java version from '11.0.1'.

Un google rápido sugiere que necesito actualizar la distributionUrl en el Gradle-wrapper. Habiendo hecho esto, me enfrento a un nuevo error:

 Cannot add task 'wrapper' as a task with that name already exists.

Sugiere que el problema está en el archivo:

 /AwesomeProject/android/build.gradle' line: 36

que se parece a esto

 task wrapper(type: Wrapper) { gradleVersion = '4.4' distributionUrl = distributionUrl.replace("bin", "all") }

He estado de un lado a otro tratando de averiguar qué hace esto. Parece extraño que algo no funcione directamente de la caja. ¿Alguien está enfrentando un problema similar?

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

También puedes actualizar

 task wp(type: Wrapper) { gradleVersion = '4.4' distributionUrl = distributionUrl.replace("bin", "all") }

para

 wp { gradleVersion = '4.4' distributionUrl = distributionUrl.replace("bin", "all") }

Como a anulación de tareas integradas obsoletas en 4.8 ahora produce un error

Intentar reemplazar una tarea integrada generará un error similar al siguiente:

No se puede agregar la tarea 'envoltura' porque ya existe una tarea con ese nombre.

consulte el último párrafo de Tareas y propiedades : https://docs.gradle.org/5.2.1/userguide/upgrading_version_4.html

y personalización de la tarea Wrapper : https://docs.gradle.org/5.2.1/userguide/gradle_wrapper.html#customizing_wrapper

over 4 years ago · Santiago Trujillo Report

0

¿Qué versión de gradle usas en tu entorno?

Si usa la versión 5.x de gradle, debe modificar el 「contenedor de tareas」como se muestra a continuación.

 task wrapper2(type: Wrapper) { gradleVersion = '4.4' distributionUrl = distributionUrl.replace("bin", "all") }

↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

 wrapper2 { gradleVersion = '4.4' distributionUrl = distributionUrl.replace("bin", "all") }
over 4 years ago · Santiago Trujillo Report

0

si el archivo "gradle-wrapper.properties" ya tiene estos códigos

 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

entonces puedes quitar

 task wrapper(type: Wrapper) { gradleVersion = '4.4' distributionUrl = distributionUrl.replace("bin", "all") }

de build.gradle

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!