Error npx react-native run-android --verbose

Hello everyone, my project build failed with the error:

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not resolve project :lottie-react-native.
     Required by:
         project :app
      > No matching configuration of project :lottie-react-native was found. The consumer was configured to find an API of a component, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.api.attributes.ProductFlavor:react-native-camera' with value 'general', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.4.2' but:
          - None of the consumable configurations have attributes.

Hard to say without seeing the build scripts, but I would guess that you do not have the android plugin applied in lottie-react-native.

1 Like

my build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 30
        targetSdkVersion = 30
        supportLibVersion = "28.0.0"
    }
    repositories {
        mavenCentral()
        google()
        jcenter()
        maven {
          url 'https://maven.fabric.io/public'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.4.2'
        classpath 'com.google.gms:google-services:4.2.0'
        classpath 'com.google.firebase:firebase-plugins:1.2.0'
        classpath 'io.fabric.tools:gradle:1.28.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        mavenLocal()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
    }
}


//task wrapper(type: Wrapper) {
wrapper {
  gradleVersion = '7.5'
  distributionUrl = distributionUrl.replace("bin", "all")
  distributionUrl='https://services.gradle.org/distributions/gradle-7.5-all.zip'
}

Ah, lottie-react-native is something you want to just use, not something you develop?
Then you should probably ask them or their documentation on how to use it.