-1

FAILURE: Build failed with an exception.

  • What went wrong: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.

Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'. Could not find com.airbnb.android:lottie:5.1.4. Required by:

My package.json enter image description here

build.gradle enter image description here

gradle.properties enter image description here

I tried to build react native android apk file with command:

  1. cd android
  2. ./gradlew clean
  3. ./gradlew build

I want to build the file android apk, Please help, Thank you everyone.

  • Please do not post relevant configuration files as image. Always include them as text (simply copy and post them into your question and format it as code). Please edit your question and do so. Please also remove the wrong tag `ios` as you are clearly trying to build an Android apk. – Robert Dec 30 '22 at 08:40

1 Answers1

0

android/build.gradle

add this line to build.gradle and try again

def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())

allprojects {
configurations.all {
resolutionStrategy {
force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
}
}

if you don't understand this here you can see all chat I have same issue but I add this line to build file and it's working for me

hope this will help you!