简体   繁体   中英

Could not determine the dependencies of task ':app:lintVitalRelease'

I am new in react native and android development. Currently I want to build an APK but I faced this error.

**FAILURE: Build failed with an exception. * What went wrong: Could not determine the dependencies of task ':app:lintVitalRelease'.

Could not resolve all task dependencies for configuration ':app:releaseRuntimeClasspath'. Could not resolve project :react-native-cookies. Required by: project :app Unable to find a matching configuration of project :react-native-cookies: None of the consumable configurations have attributes.**

In build.gradle file


    release {

      signingConfig signingConfigs.release
       matchingFallbacks = ['release', 'debug'] 
    }
  }


dependencies {
    implementation project(':react-native-cookies')
    implementation project(':react-native-clear-app-cache')
    implementation project(':react-native-vector-icons')
    implementation project(':react-native-image-picker')
    implementation project(':react-native-linear-gradient')
    implementation project(':react-native-gesture-handler')
    implementation project(':react-native-reanimated')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    implementation "com.facebook.react:react-native:+"  // From node_modules
    implementation project(':react-native-orientation')

}

In app/build.gradle file

buildscript {
    ext {
        buildToolsVersion = "28.0.3" //28.0.3
        minSdkVersion = 16
        compileSdkVersion = 28 //28
        targetSdkVersion = 28
        supportLibVersion = "28.0.0"


    }

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}


I dont know how to solve as I tried many times to modified buildToolsVersion, buildTypes and so on. Any idea to solve this issue? Please help.

In android/app/build.gradle replace:

...
androidTestImplementation 'androidx.test:runner:1.2.1' // old
androidTestImplementation 'androidx.test:runner:1.3.0-alpha03' // new
...
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.1' // old
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0-alpha03' // new
...

Please Add This into your Build.gradle

dependencies {
    def multidex_version = "2.0.1"
    implementation "androidx.multidex:multidex:$multidex_version"
}

and Also Add This

  defaultConfig {
        multiDexEnabled true
                }

This will solve your issue

Check this out

dependencies {       
    testImplementation 'junit:junit:4.+'
}

in your build:gradle (module)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM