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

262
Vistas
Getting error while running `react-native run-android`

Whle running my react native code react-native run-android getting below error. It was working proper. But after taking fresh pull from git and npm ci and after I am running then getting this error.

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
   > The minCompileSdk (30) specified in a
     dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
     is greater than this module's compileSdkVersion (android-29).
     Dependency: androidx.core:core:1.7.0-alpha01.
     AAR metadata file: C:\Users\gauraab\.gradle\caches\transforms-2\files-2.1\9e02d64f5889006a671d0a7165c73e72\core-1.7.0-alpha01\META-INF\com\android\build\gradle\aar-metadata.properties.
over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

As some has mentioned, the problem is that the RN build automatically "upgraded" to androidx.core:core:1.7.0-alpha01, which depends on SDK version 30.

The Fix

The fix is simply to specify android core version via androidXCore in build.gradle

buildscript {
    ext {
        buildToolsVersion = "29.0.3"
        minSdkVersion = 23
        compileSdkVersion = 29
        targetSdkVersion = 29
        ndkVersion = "20.1.5948944"
        kotlin_version = "1.5.0"
        androidXCore = "1.5.0"
    }

How I figured it out

Figuring this out was painful. I grepped for gradle files that would automatically upgrade packages like so

find . -name '*.gradle' -exec grep -H "\.+" {} \;

and found in node_modules/@react-native-community/netinfo/android/build.gradle the following snippet

def androidXCore = getExtOrInitialValue('androidXCore', null)
  if (supportLibVersion && androidXVersion == null && androidXCore == null) {
    implementation "com.android.support:appcompat-v7:$supportLibVersion"
  } else {
    def defaultAndroidXVersion = "1.+"
    if (androidXCore == null) {
      androidXCore = androidXVersion == null ? defaultAndroidXVersion : androidXVersion
    }
    implementation "androidx.core:core:$androidXCore"
  }
}
over 4 years ago · Santiago Trujillo Denunciar

0

Apparently they just broke this today.

You can fix it by adding the following line to your app level build.gradle file (above the android { } block as a sibling):

configurations.all {
    resolutionStrategy { force 'androidx.core:core-ktx:1.6.0' }
}

Finally, the Gradle build was successfully completed. Ref. https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.ResolutionStrategy.html

over 4 years ago · Santiago Trujillo Denunciar

0

I got same issue. Just today. When I try to run locally, I got the exact same error. To get it run again, I update the field compileSdkVersion and targetSdkVersion in file android > build.gradle from 29 to 30. Then, it can run again. If this answer fits with you, you can go with this way. But, personally, I'm lookin for solution without to change the value compileSdkVersion and targetSdkVersion

Update: just change the compileSdkVersion

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