Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

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

When installing 'react-native init AwesomeProject' I get this error when I run react-native run-android:

Could not determine java version from '11.0.1'.

A quick google suggests I need to update the distributionUrl in the Gradle-wrapper. Having done this I am faced with a new error:

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

It suggests the issue is in the file:

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

which looks like this

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

I've been back and forth trying to figure out what this does. It seems odd that something wouldn't work straight out of the box. Is anybody facing a similar issue?

over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

You can also update

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

for

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

As deprecated built-in task override in 4.8 now fails

Attempting to replace a built-in task will generate an error similar to the following:

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

see the last paragraph of Tasks and Properties : https://docs.gradle.org/5.2.1/userguide/upgrading_version_4.html

and Wrapper task customization : https://docs.gradle.org/5.2.1/userguide/gradle_wrapper.html#customizing_wrapper

over 4 years ago · Santiago Trujillo Denunciar

0

What version of gradle do you use in your environment?

If you are using gradle version 5.x, you need to modify the 「task container」 as shown below.

 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 Denunciar

0

if "gradle-wrapper.properties" file already have these codes

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

then you can remove

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

from build.gradle

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda