React Native Navigation Error building Android,:app@debug/compileClasspath': Could not resolve project :react-native-navigation

unable to resolve dependency for ' app@debug/compileclasspath' could not resolve project
unable to find a matching configuration of project :react-native-navigation:
unable to resolve dependency for ':@debug/compileclasspath': could not resolve project :cordovalib.
unable to resolve react-native navigation
gradle unable to resolve dependency
required com android build api attributes buildtypeattr debug' and found compatible value 'debug
missingdimensionstrategy
could not resolve project :react-native rate

I'm trying to install react-native-navigation(wix) package, I'm following the steps on android(https://wix.github.io/react-native-navigation/#/installation-android) but in android studio the build fails with the message. Gradle 4.1( I don't know if this is related)

Could not resolve project :react-native-navigation.
Required by:
project :app

Unable to find a matching configuration of project :react-native-navigation: None of the consumable configurations have attributes.

Error:Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve project :react-native-navigation.
Open File
Show Details

Error:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve project :react-native-navigation.
Open File
Show Details

Error:Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve project :react-native-navigation.
Open File
Show Details

Error:Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve project :react-native-navigation.
Open File
Show Details

Error:Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve project :react-native-navigation.

I leave the details below(my user is called home, is not a typo):

Issue Description local.properties file

sdk.dir=/home/home/Android/Sdk

settings.gradle

include ':app'
include ':react-native-navigation'
project(':react-native-navigation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-navigation/android/app/')
App gradle file

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    defaultConfig {
        applicationId "com.example.home.myapplication"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "com.android.support:appcompat-v7:25.0.1"
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
   //tried implementation as well here instead of compile but didn't work either 
   compile project(':react-native-navigation')

}
Environment
  • React Native Navigation version: "1.1.370"
  • React Native version: "0.52.0"
  • Platform(s) (iOS, Android, or both?): Android
  • Device info (Simulator/Device? OS version? Debug/Release?): Android Studio

Which version of gradle and android api should I use with react native? Is there any way to solve this? I see that my app gradle file is nothing alike the instructions, that compile project statement is not valid in my version of gradle. Any idea? Maybe the local.settings is wrong and is not finding the files?...Any help would be appreciated

We also get the same problem on my android app, Here is the solution.
 Follow the steps to overcome this error.

     Step 1:

    Requirements
    node >= 8
    react-native >= 0.51

    Step 2:
    npm install --save react-native-navigation

    Step 3:
    Add the following in android/settings.gradle:

    include ':react-native-navigation'

    project(':react-native-navigation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-navigation/lib/android/app/')

    Step 4: 
    Make sure you're using the new gradle plugin, edit android/gradle/wrapper/gradle-wrapper.properties

    distributionBase=GRADLE_USER_HOME
    distributionPath=wrapper/dists
    zipStoreBase=GRADLE_USER_HOME
    zipStorePath=wrapper/dists
    +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
    -distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

    Step 5:
    Update android/build.gradle:

    buildscript {
        repositories {
    +        google()
    +        mavenLocal()
    +        mavenCentral()
    +        jcenter()
    -        maven {
    -            url 'https://maven.google.com/'
    -            name 'Google'
    -        }
        }
        dependencies {
    +        classpath 'com.android.tools.build:gradle:3.0.1'
    -        classpath 'com.android.tools.build:gradle:2.2.3'
        }
    }

    allprojects {
        repositories {
    +        google()
    +        mavenCentral()
            mavenLocal()
            jcenter()
            maven {
                // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
                url "$rootDir/../node_modules/react-native/android"
            }
    -        maven {
    -            url 'https://maven.google.com/'
    -            name 'Google'
    -        }
    +        maven { url 'https://jitpack.io' }
        }
    }

    ext {
    -    buildToolsVersion = "26.0.3"
    +    buildToolsVersion = "27.0.3"
    -    minSdkVersion = 16
    +    minSdkVersion = 19
        compileSdkVersion = 26
        targetSdkVersion = 26
        supportLibVersion = "26.1.0"
    }

    Step 6:
    Update project dependencies in android/app/build.gradle.
    android {
        compileSdkVersion rootProject.ext.compileSdkVersion
        buildToolsVersion rootProject.ext.buildToolsVersion

        defaultConfig {
            applicationId "com.yourproject"
            minSdkVersion rootProject.ext.minSdkVersion
            targetSdkVersion rootProject.ext.targetSdkVersion
            versionCode 1
            versionName "1.0"
            ndk {
                abiFilters "armeabi-v7a", "x86"
            }
        }
    +    compileOptions {
    +        sourceCompatibility JavaVersion.VERSION_1_8
    +        targetCompatibility JavaVersion.VERSION_1_8
    +    }
        ...
    }

    dependencies {
    -    compile fileTree(dir: "libs", include: ["*.jar"])
    -    compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    -    compile "com.facebook.react:react-native:+"  // From node_modules
    +    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-navigation')
    }

    Step 7: 
    Update MainActivity.java
    MainActivity.java should extend com.reactnativenavigation.NavigationActivity instead of ReactActivity.
    This file is located in android/app/src/main/java/com/<yourproject>/MainActivity.java.
    -import com.facebook.react.ReactActivity;
    +import com.reactnativenavigation.NavigationActivity;

    -public class MainActivity extends ReactActivity { 
    +public class MainActivity extends NavigationActivity {
    -    @Override
    -    protected String getMainComponentName() {
    -        return "yourproject";
    -    }
    }

    Step 7:
    Update MainApplication.java
    This file is located in android/app/src/main/java/com/<yourproject>/MainApplication.java.
    ...
    import android.app.Application;

    import com.facebook.react.ReactApplication;
    import com.facebook.react.ReactNativeHost;
    import com.facebook.react.ReactPackage;
    import com.facebook.react.shell.MainReactPackage;
    import com.facebook.soloader.SoLoader;

    +import com.reactnativenavigation.NavigationApplication;
    +import com.reactnativenavigation.react.NavigationReactNativeHost;
    +import com.reactnativenavigation.react.ReactGateway;

    import java.util.Arrays;
    import java.util.List;

    -public class MainApplication extends Application implements ReactApplication {
    +public class MainApplication extends NavigationApplication {
    +    
    +    @Override
    +    protected ReactGateway createReactGateway() {
    +        ReactNativeHost host = new NavigationReactNativeHost(this, isDebug(), createAdditionalReactPackages()) {
    +            @Override
    +            protected String getJSMainModuleName() {
    +                return "index";
    +            }
    +        };
    +        return new ReactGateway(this, isDebug(), host);
    +    }
    +
    +    @Override
    +    public boolean isDebug() {
    +        return BuildConfig.DEBUG;
    +    }
    +
    +    protected List<ReactPackage> getPackages() {
    +        // Add additional packages you require here
    +        // No need to add RnnPackage and MainReactPackage
    +        return Arrays.<ReactPackage>asList(
    +            // eg. new VectorIconsPackage()
    +        );
    +    }
    +  
    +    @Override
    +    public List<ReactPackage> createAdditionalReactPackages() {
    +        return getPackages();
    +    }
    - ...
    +}

    Step 8: 
    RNN and React Native version

    react-native-navigation supports multiple React Native versions. Target the React Native version required by your project by specifying the RNN build flavor in android/app/build.gradle.

    android {
        ...
        defaultConfig {
            applicationId "com.yourproject"
            minSdkVersion rootProject.ext.minSdkVersion
            targetSdkVersion rootProject.ext.targetSdkVersion
    +        missingDimensionStrategy "RNN.reactNativeVersion", "reactNative57" // See note below!
            versionCode 1
            versionName "1.0"
            ...
        }
        ...
    }

For the more details, you can follow this link enter link description here

wix/react-native-navigation, Could not resolve project :react-native-navigation #4595 ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not Show Details Affected Modules: app ERROR: Unable to resolve dependency for dependencies { classpath 'com.android.tools.build:gradle:3.1.4' classpath  Hello, I'm following the steps on android but in android studio the build fails with the message. Gradle 4.1( I don't know if this is related) Could not resolve project :react-native-navigation.

The problem was that the last gradle version wasn't compatible with the package as I suspected. I had to use gradle 3 in the end and everything worked

ERROR: Unable to resolve dependency for ':app@debug , THIS OUT] Environment React Native Navigation version: FILL THIS OUT React Native version: FILL THIS OUT Platform(s) (iOS, Android, or both to host and review code, manage projects, and build software together. ERROR: Unable to resolve dependency for ':app@debug/compileClasspath':  Dismiss Join GitHub today. GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

Environment

React Native Navigation version: "2.0.2502"
React Native version: "0.56.0"
Platform(s) (iOS, Android, or both?): Android
Device info (Simulator/Device? OS version? Debug/Release?): Android Studio

I followed the official documentation, then had the same issue. In my situation I moved the 'RNN' folder within my react-native project's node_modules, then Gradle worked.

React Native Navigation Error building Android,:app@debug , We also get the same problem on my android app, Here is the solution. Follow the steps to overcome this error. Step 1: Requirements node >= 8 react-native  vijaygopal balasa is a tech avid and digital marketer. He likes to write and share about apps, games, gadgets, smartphones and Tech Reviews. He is a Blogger, Half-Geek, Half-Nerd.

Do you have the Android SDK 27 installed? Open your Android SDK Manager in Android Studio and make sure you install that version there. Also try creating an emulator that is based on that version.

Error building Android, Unable to resolve dependency , Ask questionsError building Android, Unable to resolve dependency for ':app@​debug/compileClasspath': Could not resolve project :react-native-navigation. Hello,. If you're already familiar with React Native then you'll be able to get moving with React Navigation quickly! If not, you may want to read sections 1 to 4 (inclusive) of React Native Express first, then come back here when you're done.

Android studio 3.0: Unable to resolve dependency for :app , Error building Android, Unable to resolve dependency for ':app , ERROR: Unable to resolve Unable to resolve dependency for ' app@debug/compile classpath' could not resolve project Could not resolve project :react-native-navigation. Provides a way for your app to transition between screens where each new screen is placed on top of a stack. By default the stack navigator is configured to have the familiar iOS and Android look & feel: new screens slide in from the right on iOS, fade in from the bottom on Android.

Unable to resolve dependency for ':app@debug/compileClasspath , I expect the react-native-maps project to be included in the main project Unable to resolve dependency for ':react-native-maps@debug/compileClasspath'​: Could not resolve 'com.android.tools.build:gradle:3.3.1' // NOTE: Do not place your application react native maps React-native build error: Execution failed for task  Closing because you haven't followed the issue template; please open a new one that follows the template. Without that, it's nearly impossible to understand & investigate the issue.

[Solved]react native maps Unable to resolve Gradle dependencies, I add this to android/app/build.gradle dependencies { compile for ':app#debug/​compileClasspath': Could not resolve project :react-native-navigation. I switched from react native navigation v1 to v2 and I have theses 5 errors when trying to  React Navigation is extensible at every layer— you can write your own navigators or even replace the user-facing API. React Navigation is built and funded by Expo & Software Mansion , with contributions from the community .

Comments
  • hi, im facing the same issue. can you be more specific how you fix this problem ?