1
votes

I am working with react-native-navigation, but not able to configure it in Android Studio as per the Given documentation. Android Studio was given

Error:

Error: Project: app declares a dependency from configuration 'compile' to configuration 'default' which is not declared in the descriptor for project :react-native-navigation.

My React Native Version is : 0.50.3 and npm version is :5.4.2.

Steps that I followed are.

  1. Create React Native Project.

  2. Go inside the Project folder.

  3. Run npm install --save react-native-navigation.

  4. Open Android project(inside the react native project) into the android studio.

  5. copy the code given code into settings.gradle

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

6.Copy the given code inside build.gradle(app)

compile project(':react-native-navigation')

So I am getting this error in the final step.

Please let me know if any quick fix is there.

Any help will be appreciated.

1
Did u find the solution? - Sathya Baman
@sathyabaman no i didn't, i dropped that project and created the other one, it worked in the new project - Ajeet Choudhary

1 Answers

0
votes

Ok. I was getting the same error. My situation was, I tried to create a separate native Android Library and tried to link it with the reactive project.

This issue comes when I run react-native run-android or npm run android. We are pretty sure, the issue occurs during the android build.

Solution what I tried was. I build my new android library and the android package using the android studio. Then I run the react-native run-android command in root react-native project folder.

It worked for me...