React-native-navigation: Can't sync project with gradle files

Created on 12 Aug 2019  ·  10Comments  ·  Source: wix/react-native-navigation

Issue Description

Once I followed the steps for the installation on Android and try to sync gradle files (to have com.reactnativenavigation package available to use in MainActivity and MainApplication) I get the following error:

ERROR: The module 'react-native-navigation' is an Android project without build variants, and cannot be built.
Please fix the module's configuration in the build.gradle file and sync the project again. 

Steps to Reproduce / Code Snippets / Screenshots



Start a new project with RN 0.60 and follow the steps in the instructions for Android.


Environment

  • React Native Navigation version: 2.26.5
  • React Native version: 0.60.4
  • Platform(s) (iOS, Android, or both?): Android
  • Device info (Simulator/Device? OS version? Debug/Release?): Android Studio Sync Gradle Files
🏚 stale

Most helpful comment

Guys if you wish to use this library with [email protected].*, you need to use [email protected] version

And since it's still in alpha you can access the new updated installation guide manually in /doc folder in v3 branch.

All 10 comments

I have the same problem. After looking through the documentation it looks like it could use some updating

Guys if you wish to use this library with [email protected].*, you need to use [email protected] version

And since it's still in alpha you can access the new updated installation guide manually in /doc folder in v3 branch.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

The issue has been closed for inactivity.

@jinshin1013 I've switched to v3 branch but i still see the old docs for some reason https://github.com/wix/react-native-navigation/blob/v3/docs/docs/Installing.md...

V3 doc should now be in the master branch as it got merged.

I've followed the installation docs on master and it doesn't work for me, and it looks the same as the old stuff, i don't see the new merged changes on master branch...
Anyways I'm using [email protected]
It works fine on iOS, it's just the android that doesn't work.

Can you please paste for me what you currently have working on MainApplication.Java? I'm getting errors on android that have to do with the getPackages() method.

Managed to get it working thanks to @sijad.
For anyone using react >0.60.*, here's a great working example of how to integrated with react-native-navigation v3.

In case this is of help for anyone ending up here as well after Googling the error message mentioned above:
I had the same error _"The module 'react-native-navigation' is an Android project without build variants, and cannot be built."_ but then I realised I accidentally filtered out all variants even the latest one that I needed when I was following instructions at step 5.2.

It seems to be working now. I pushed my project configuration with React Native 0.61.2 and react-native-navigation 3.2.0 to a public GitHub repo.

thank you @crocodile.

Was this page helpful?
0 / 5 - 0 ratings